Skip to content

update AGP to 9.3.1 - #547

Open
Kimblebee wants to merge 3 commits into
mainfrom
kim/dependency/update-gradle-9.3.1
Open

update AGP to 9.3.1#547
Kimblebee wants to merge 3 commits into
mainfrom
kim/dependency/update-gradle-9.3.1

Conversation

@Kimblebee

@Kimblebee Kimblebee commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

This PR upgrades the project's build infrastructure to support Android Gradle Plugin (AGP) 9.3.1 and Gradle 9.6.1. It preserves the existing context receivers syntax, migrating only the compiler configuration.

1. Build & Dependency Updates

  • Upgrades: AGP to 9.3.1, Gradle Wrapper to 9.6.1, and Hilt to 2.59.2.
  • Kotlin Migration: Moved 39 submodules from the deprecated kotlin.android plugin to AGP's built-in Kotlin support.
    * Kapt Migration: Replaced kotlin.kapt with legacy-kapt across 22 submodules (required for Hilt compatibility with built-in Kotlin before migrating to KSP).
    * Configs: Enabled parallel sync in gradle.properties and updated README.md for Android Studio Quail requirements.

2. Compiler Flag Relocation

  • Relocated the -Xcontext-receivers flag from the deprecated kotlinOptions block to the new top-level kotlin.compilerOptions block across 11 modules to keep context receivers active under built-in Kotlin. (see PR Replace Context Receivers with Context Parameters #548 for full conversion to current Context Parameters)

3. Gradle 9 / AGP 9 Compatibility Fixes

  • Empty Module Removal: Removed include(":data:model") from settings.gradle.kts as Gradle 9 strictly forbids including project directories that do not exist or lack build files.
  • ProGuard Fix: Created an empty data/camera/consumer-rules.pro file because AGP 9 requires all declared consumer ProGuard files to exist on disk.

dog mopping the floor

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the project's build configuration, including upgrading Gradle, the Android Gradle Plugin (AGP), and Hilt, while transitioning from Kotlin context receivers to context parameters. It also removes the kotlin-android plugin across modules and replaces kotlin-kapt with android-legacy-kapt. Feedback highlights several critical issues: the removal of the essential kotlin-android plugin will break Kotlin compilation, and the specified versions for Gradle (9.6.0), AGP (9.3.1), and the com.android.legacy-kapt plugin do not exist, which will cause build and dependency resolution failures. Additionally, removing consumerProguardFiles from the camera data module risks runtime crashes in obfuscated builds. Finally, there are formatting and indentation issues in CameraSession.kt and several build.gradle.kts files that violate Kotlin style guidelines.

Comment thread build.gradle.kts
Comment thread gradle/wrapper/gradle-wrapper.properties Outdated
Comment thread gradle/libs.versions.toml
Comment thread gradle/libs.versions.toml
Comment thread data/camera/build.gradle.kts
Comment thread core/camera/src/main/java/com/google/jetpackcamera/core/camera/CameraSession.kt Outdated
Comment thread ui/components/build.gradle.kts
@Kimblebee
Kimblebee force-pushed the kim/dependency/update-gradle-9.3.1 branch 3 times, most recently from 07f719f to 07ae446 Compare July 31, 2026 14:44
@Kimblebee

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Android Gradle Plugin to version 9.3.1, Gradle wrapper to 9.6.1, and Hilt to 2.59.2, alongside migrating modules to use the legacy KAPT plugin and modernizing Kotlin compiler options. It also removes obsolete testing workarounds. The review feedback highlights minor formatting and indentation inconsistencies in the kotlin configuration blocks across several build.gradle.kts files, which should be cleaned up to adhere to the Kotlin style guide.

Comment thread core/camera/effects/single-stream/build.gradle.kts
Comment thread feature/postcapture/build.gradle.kts Outdated
Comment thread ui/components/capture/build.gradle.kts
Comment thread ui/controller/build.gradle.kts
Comment thread ui/controller/impl/build.gradle.kts
Comment thread ui/uistate/build.gradle.kts
Comment thread ui/uistate/capture/build.gradle.kts
Comment thread ui/uistateadapter/build.gradle.kts
Comment thread ui/uistateadapter/capture/build.gradle.kts
@Kimblebee Kimblebee changed the title update gradle version to 9.3.1 update AGP to 9.3.1 Jul 31, 2026
@Kimblebee
Kimblebee force-pushed the kim/dependency/update-gradle-9.3.1 branch from 6d828d9 to c5db5b5 Compare July 31, 2026 17:22
Upgrades the project's build system:
- Upgraded Android Gradle Plugin to 9.3.1 and Gradle Wrapper to 9.6.1.
- Migrated all modules from 'kotlin.android' to AGP's built-in Kotlin support.
- Replaced 'kotlin.kapt' with 'legacy-kapt' for compatibility with built-in Kotlin.
- Upgraded Hilt to 2.59.2 for AGP 9 compatibility.
- Updated compiler flags to pass -Xcontext-receivers under the new built-in Kotlin configuration block in 11 modules.
- Updated README to reflect Android Studio Quail / AGP 9 requirements.
- Enabled parallel Gradle sync in gradle.properties.
    Deletes the unused and duplicated test helper classes in :ui:components:capture. Gradle 9 fails the build if a module contains test sources but no actual @test classes to execute, which was the case here since it only contained test utilities.
@Kimblebee
Kimblebee force-pushed the kim/dependency/update-gradle-9.3.1 branch from c5db5b5 to 178f266 Compare August 1, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant