Skip to content

Conversation

@SimonMarquis
Copy link
Contributor

@SimonMarquis SimonMarquis commented Sep 14, 2025

This neat website can be used to track the current issues with AGP 9: https://agp-status.frybits.com/agp-9.0.0/

⚠️ TODO before merging PR

✅ Fixed issues

  • Firebase Perf Plugin does not work with latest AGP 9 alpha firebase/firebase-android-sdk#7293 (fixed in Firebase BoM 34.5.0)
  • AGP 9.0.0-alpha03 produces circular dependency on KSP tasks
    fixed in KSP 2.2.20-2.0.3
  • Avoid using old Variant API extending JavaCompile task gradle/android-cache-fix-gradle-plugin#1886
    Temporary workaround with android.newDsl=false
    > Failed to apply plugin 'org.gradle.android.cache-fix'.
       > Could not get unknown property 'unitTestVariants' for object of type com.android.build.gradle.internal.dsl.ApplicationExtensionImpl$AgpDecorated.
    
  • Regarding AGP 9 and built-in Kotlin. google/ksp#2615 (fixed in KSP 2.3.1-SNAPSHOT)
  • release build type has isDebuggable forced to true, even when explicitly turned off.
    AGPBI: {"kind":"warning","text":"BuildType 'release' is both debuggable and has 'isMinifyEnabled' set to true.\nAll code optimizations and obfuscation are disabled for debuggable builds.","sources":[{}]}
    
    fixed in 52b118a
  • Update to Gradle 9.2.0 to fix the issue
    WARNING: Unsupported Kotlin plugin version.
    The `embedded-kotlin` and `kotlin-dsl` plugins rely on features of Kotlin `2.2.0` that might work differently than in the requested version `2.2.10`.
    
  • androidx.baselineprofile issue, flagged as error starting with AGP beta05 (fixed in version 1.5.0-alpha01):
    A problem occurred configuring project ':app'.
    > Using kotlin.sourceSets DSL to add Kotlin sources is not allowed with built-in Kotlin.
      Kotlin source set 'demoBenchmarkRelease' contains: [/home/runner/work/nowinandroid/nowinandroid/app/build/generated/ksp/demoBenchmarkRelease/kotlin, /home/runner/work/nowinandroid/nowinandroid/app/build/generated/ksp/demoBenchmarkRelease/java]
      Solution: Use android.sourceSets DSL instead.
      For more information, see https://developer.android.com/r/tools/built-in-kotlin
      To suppress this error, set android.disallowKotlinSourceSets=false in gradle.properties.
    

@SimonMarquis SimonMarquis marked this pull request as draft September 14, 2025 12:35
@SimonMarquis SimonMarquis force-pushed the agp-9 branch 2 times, most recently from d2767d1 to a19fcd9 Compare September 21, 2025 08:45
`error: cannot find symbol` on:

- `DataStoreModule.INSTANCE.providesUserPreferencesDataStore$datastore_demoDebug`
- `SyncModule.Companion.provideFirebaseMessaging$work_prodDebug()`
They must have been removed as they are no longer resolved by default.
Updated Android Gradle Plugin and Tools versions.
@liutikas
Copy link
Collaborator

liutikas commented Nov 6, 2025

release build type has isDebuggable forced to true, even when explicitly turned off.

Can you point me to how to repro this?

@SimonMarquis
Copy link
Contributor Author

I've not been able to reproduce it on my other projects, but on this one, simply build a release app with gradlew :app:assembleDemoRelease.

not sure if they were dropped on purpose...
@SimonMarquis SimonMarquis force-pushed the agp-9 branch 2 times, most recently from 101662a to cf6e7dd Compare November 7, 2025 20:54
Updated Android Gradle Plugin and tools to beta versions.
- Redundant suppression
- UnstableApiUsage
- There is more than one label with such a name in this scope.
@liutikas liutikas changed the title 🚧 AGP 9 AGP 9 Dec 19, 2025
@liutikas
Copy link
Collaborator

Can you please rebase the merge conflicts?

@SimonMarquis
Copy link
Contributor Author

SimonMarquis commented Jan 15, 2026

AGP 9.0.0 does not seem to have added the corresponding android {} extensions to configure android modules. Which means we get these warnings:~~

'fun Project.android(configure: Action<BaseAppModuleExtension>): Unit' is deprecated. Replaced by com.android.build.api.dsl.ApplicationExtension.
This class is not used for the public extensions in AGP when android.newDsl=true, which is the default in AGP 9.0, and will be removed in AGP 10.0.
'fun Project.android(configure: Action<TestExtension>): Unit' is deprecated. Replaced by com.android.build.api.dsl.TestExtension.
This class is not used for the public extensions in AGP  when android.newDsl=true, which is the default in AGP 9.0, and will be removed in AGP 10.0.
 'fun Project.android(configure: Action<LibraryExtension>): Unit' is deprecated. Replaced by com.android.build.api.dsl.LibraryExtension.
This class is not used for the public extensions in AGP when android.newDsl=true, which is the default in AGP 9.0, and will be removed in AGP 10.0.

We could add them ourselves in the build-logic and expose them as public API until they offer a solution, or ignore the warning for now, wdyt?

fun Project.androidApp(configure: ApplicationExtension.() -> Unit) = configure<ApplicationExtension>(configure)
fun Project.androidLibrary(configure: LibraryExtension.() -> Unit) = configure<LibraryExtension>(configure)
fun Project.androidTest(configure: TestExtension.() -> Unit) = configure<TestExtension>(configure)

EDIT: It seems like this only happens when android.newDsl=false, so I guess we should not try to work around it and wait for the proper solution of enabling the new DSL.

SimonMarquis and others added 6 commits January 15, 2026 20:08
… version

```
[Hilt] Provided Metadata instance has version 2.3.0, while maximum supported version is 2.2.0. To support newer versions, update the kotlin-metadata-jvm library.: java.lang.IllegalArgumentException: Provided Metadata instance has version 2.3.0, while maximum supported version is 2.2.0. To support newer versions, update the kotlin-metadata-jvm library.
```
@liutikas liutikas marked this pull request as ready for review January 20, 2026 16:40
@liutikas liutikas merged commit 2c56ce1 into android:main Jan 20, 2026
6 checks passed
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.

4 participants