You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #59: migrate workout-logger/android to Android Gradle Plugin (AGP) 9.0+ to actually activate the android.builtInKotlin and android.newDsl gradle.properties flags that were added automatically by the Flutter migrator in #59. On the current AGP version (8.11.1), these flags are inert placeholders because Flutter's Gradle plugin only enables built-in Kotlin support when AGP major version >= 9.
Background
workout-logger/android/gradle.properties sets android.builtInKotlin=true and android.newDsl=true, but Flutter's Gradle plugin (FlutterPluginUtils.isBuiltInKotlinEnabled) explicitly forces this to false when AGP major version < 9.
The project currently pins com.android.application and org.jetbrains.kotlin.android to 8.11.1 / 2.2.20 in workout-logger/android/settings.gradle.kts.
Official AGP compileSdk compatibility tables list API level 37 (already targeted in Feat/android 17 #59) as requiring minimum AGP 9.1.1, not just 9.0.1.
Required changes
workout-logger/android/settings.gradle.kts
Bump com.android.application plugin version to 9.1.1+ (not just 9.0.1, due to compileSdk 37 compatibility requirements).
Remove the org.jetbrains.kotlin.android plugin declaration entirely — AGP 9's new DSL is not compatible with the standalone Kotlin Android plugin; built-in Kotlin support handles this instead.
Bump Gradle distribution to >= 9.1.0 (AGP 9.0's minimum Gradle requirement).
workout-logger/android/app/build.gradle.kts
Rewrite the ABI-specific versionCodeOverride logic, currently implemented via the legacy android.applicationVariants.configureEach { ... } API (casting output to ApkVariantOutputImpl), using the new androidComponents.onVariants(...) variant API. This is the biggest non-trivial code change required.
Migrate the kotlinOptions { jvmTarget = ... } block to the built-in-Kotlin equivalent DSL (e.g., kotlin { compilerOptions { jvmTarget = ... } }), verifying against Flutter's built-in Kotlin migration docs at the time of the upgrade.
Compatibility verification (risk items, not pure version bumps)
Confirm Flutter's flutter-gradle-plugin (pinned via Flutter SDK 3.44.4+ per Feat/android 17 #59) has stable-channel support for AGP major version 9 before committing to the bump.
Re-verify the F-Droid signing-block-stripping logic in app/build.gradle.kts (the comment about signingConfig needing to stay on one line) still holds under the new DSL/variant API.
Summary
Follow-up to #59: migrate
workout-logger/androidto Android Gradle Plugin (AGP) 9.0+ to actually activate theandroid.builtInKotlinandandroid.newDslgradle.properties flags that were added automatically by the Flutter migrator in #59. On the current AGP version (8.11.1), these flags are inert placeholders because Flutter's Gradle plugin only enables built-in Kotlin support when AGP major version >= 9.Background
workout-logger/android/gradle.propertiessetsandroid.builtInKotlin=trueandandroid.newDsl=true, but Flutter's Gradle plugin (FlutterPluginUtils.isBuiltInKotlinEnabled) explicitly forces this tofalsewhen AGP major version < 9.com.android.applicationandorg.jetbrains.kotlin.androidto 8.11.1 / 2.2.20 inworkout-logger/android/settings.gradle.kts.Required changes
workout-logger/android/settings.gradle.ktscom.android.applicationplugin version to9.1.1+ (not just9.0.1, due to compileSdk 37 compatibility requirements).org.jetbrains.kotlin.androidplugin declaration entirely — AGP 9's new DSL is not compatible with the standalone Kotlin Android plugin; built-in Kotlin support handles this instead.workout-logger/android/gradle/wrapper/gradle-wrapper.properties>= 9.1.0(AGP 9.0's minimum Gradle requirement).workout-logger/android/app/build.gradle.ktsversionCodeOverridelogic, currently implemented via the legacyandroid.applicationVariants.configureEach { ... }API (casting output toApkVariantOutputImpl), using the newandroidComponents.onVariants(...)variant API. This is the biggest non-trivial code change required.kotlinOptions { jvmTarget = ... }block to the built-in-Kotlin equivalent DSL (e.g.,kotlin { compilerOptions { jvmTarget = ... } }), verifying against Flutter's built-in Kotlin migration docs at the time of the upgrade.Compatibility verification (risk items, not pure version bumps)
flutter-gradle-plugin(pinned via Flutter SDK3.44.4+ per Feat/android 17 #59) has stable-channel support for AGP major version 9 before committing to the bump.app/build.gradle.kts(the comment aboutsigningConfigneeding to stay on one line) still holds under the new DSL/variant API.Affected files
workout-logger/android/settings.gradle.ktsworkout-logger/android/gradle/wrapper/gradle-wrapper.propertiesworkout-logger/android/app/build.gradle.ktsworkout-logger/android/gradle.properties(flags already in place from Feat/android 17 #59, will become active)Acceptance criteria
9.1.1+ insettings.gradle.kts,org.jetbrains.kotlin.androidplugin declaration removed.>= 9.1.0.android.applicationVariants.configureEachABI versionCode logic migrated toandroidComponents.onVariants(...).kotlinOptions.jvmTargetmigrated to the built-in-Kotlin equivalent..github/workflows/release.yml,.github/workflows/test.yml) confirmed to require no changes (JDK 17 already set viaactions/setup-java@v4).References