Problem
Applying com.appswithlove.updraft 2.3.0 to an app module on AGP 9 (tested 9.3.1, Gradle 9.6.1) fails at configuration time:
com.android.build.gradle.internal.dsl.ApplicationExtensionImpl$AgpDecorated_Decorated
cannot be cast to class com.android.build.gradle.AppExtension
The plugin hard-casts the android {} extension to the legacy com.android.build.gradle.AppExtension type, which AGP 9 removed. Reproduced 3× during the updraft-sdk AGP 9 migration; android.enableLegacyVariantApi=true does NOT help — it's an API-shape incompatibility, not a variant-API issue.
Fix direction
Replace the AppExtension cast with the modern DSL/AndroidComponents APIs:
project.extensions.getByType(com.android.build.api.dsl.ApplicationExtension::class.java) for DSL access, and/or
ApplicationAndroidComponentsExtension (onVariants { }) for variant-aware wiring (APK paths, variant names).
These APIs exist since AGP 7.x, so the fix can stay backwards-compatible with AGP 7/8 consumers.
Follow-up once released
⚠️ After a compatible version ships: update appswithlove/updraft-sdk — the plugin is currently parked there (commented out with a TODO(#16) marker in sample/androidApp/build.gradle.kts, see updraft-sdk PR #20 / updraft-sdk#16). Re-enabling = bump updraft in gradle/libs.versions.toml + uncomment the plugin alias, updraft {} block, and updraft_uploadUrl wiring. Until then the sample app cannot upload builds to Updraft.
Problem
Applying
com.appswithlove.updraft2.3.0 to an app module on AGP 9 (tested 9.3.1, Gradle 9.6.1) fails at configuration time:The plugin hard-casts the
android {}extension to the legacycom.android.build.gradle.AppExtensiontype, which AGP 9 removed. Reproduced 3× during the updraft-sdk AGP 9 migration;android.enableLegacyVariantApi=truedoes NOT help — it's an API-shape incompatibility, not a variant-API issue.Fix direction
Replace the
AppExtensioncast with the modern DSL/AndroidComponents APIs:project.extensions.getByType(com.android.build.api.dsl.ApplicationExtension::class.java)for DSL access, and/orApplicationAndroidComponentsExtension(onVariants { }) for variant-aware wiring (APK paths, variant names).These APIs exist since AGP 7.x, so the fix can stay backwards-compatible with AGP 7/8 consumers.
Follow-up once released
appswithlove/updraft-sdk— the plugin is currently parked there (commented out with aTODO(#16)marker insample/androidApp/build.gradle.kts, see updraft-sdk PR #20 / updraft-sdk#16). Re-enabling = bumpupdraftingradle/libs.versions.toml+ uncomment the plugin alias,updraft {}block, andupdraft_uploadUrlwiring. Until then the sample app cannot upload builds to Updraft.