Migrate shared_preferences_android to built-in Kotlin#11767
Migrate shared_preferences_android to built-in Kotlin#11767faisalansari0367 wants to merge 2 commits into
Conversation
- Remove explicit kotlin-gradle-plugin dependency - Remove kotlin-android plugin application - Update to use Flutter's built-in Kotlin support Fixes Flutter warning about plugins applying KGP
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request migrates the Android shared preferences plugin to built-in Kotlin support and updates the version to 2.4.24. Feedback suggests removing a redundant legacy Kotlin configuration block to ensure compatibility with AGP 9+ and restoring a removed changelog entry regarding the minimum supported SDK version.
| project.extensions.configure(org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension::class.java) { | ||
| compilerOptions { | ||
| jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 | ||
| } | ||
| } |
There was a problem hiding this comment.
This block correctly implements the recommended way to configure Kotlin for the built-in support migration. However, it is currently redundant because the jvmTarget is also configured in the kotlin { ... } block at lines 40-44.
To follow the migration guide correctly and avoid potential build failures on AGP 9+ (where the kotlin DSL extension might not be available), you should remove the existing kotlin block at lines 40-44 and keep this project.extensions.configure block.
Additionally, since JvmTarget is already imported at line 1, you can use the simplified name.
project.extensions.configure(org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension::class.java) {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}| ## 2.4.24 | ||
|
|
||
| * Updates minimum supported SDK version to Flutter 3.38/Dart 3.10. | ||
| - Migrates to built-in Kotlin |
There was a problem hiding this comment.
The changelog entry for the minimum supported SDK version update (Flutter 3.38/Dart 3.10) from the NEXT section has been removed. If this change is intended to be included in version 2.4.24, it should be preserved alongside the Kotlin migration entry.
| ## 2.4.24 | |
| * Updates minimum supported SDK version to Flutter 3.38/Dart 3.10. | |
| - Migrates to built-in Kotlin | |
| ## 2.4.24 | |
| - Migrates to built-in Kotlin | |
| - Updates minimum supported SDK version to Flutter 3.38/Dart 3.10. |
Removes explicit Kotlin Gradle Plugin dependency and migrates to Flutter's built-in Kotlin support per the breaking-changes migration guide.