fix(android): remove jcenter() and legacy AGP buildscript pin for AGP 9 - #210
Open
ameyanaik11 wants to merge 1 commit into
Open
fix(android): remove jcenter() and legacy AGP buildscript pin for AGP 9#210ameyanaik11 wants to merge 1 commit into
ameyanaik11 wants to merge 1 commit into
Conversation
- Remove the buildscript block that pinned AGP 4.1.0 and pulled it (and
the app-level rootProject.allprojects repositories) from jcenter(),
which JFrog shut down in 2021 and which Gradle 9 no longer even
exposes a jcenter() repository method for. Modern Flutter plugins
resolve their AGP/Gradle version from the consuming app's root
project instead of pinning their own, so this block was both broken
and unnecessary.
- Apply the plugin the standard way for a Flutter Android library
module (apply plugin: 'com.android.library', no local version pin).
- Raise compileSdkVersion/minSdkVersion off the 2020-era defaults (33/16)
to values consistent with current Flutter plugin conventions.
- Migrate the deprecated lintOptions block to lint {}.
This unblocks building any app that depends on this plugin under
Android Gradle Plugin 9.x, where the old buildscript-based
configuration fails outright (jcenter() is gone, and the app-level
android.newDsl=true default in AGP 9.0 no longer tolerates a
sub-project pulling in its own separate AGP classpath).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the legacy
buildscriptblock inandroid/build.gradlethat:jcenter(), which JFrog shut down in 2021 and which Gradle 9 no longer exposes ajcenter()repository method for at alljcenter()into the consuming app'srootProject.allprojectsrepositoriesAlso applies
com.android.librarythe standard way for a modern Flutter plugin module (no local AGP version pin — resolved from the consuming app's root project instead), migrates the deprecatedlintOptionsblock tolint {}, and raisescompileSdkVersion/minSdkVersionoff the 2020-era defaults (33/16).Why
Any app that depends on this plugin and builds with Android Gradle Plugin 9.x fails outright during Gradle configuration:
followed by a second failure because
kotlin-android(applied by the consuming app or other plugins) can no longer find a working Android Gradle Plugin classpath once the sub-project's own broken buildscript block is evaluated. AGP 9.0 also defaultsandroid.newDsl=true, which no longer tolerates a sub-project pulling in its own separate AGP classpath the old way.Testing
Verified against a real app (Flutter 3.47.2, AGP 9.1.0, Gradle 9.3.1, Kotlin 2.4.0, compileSdk 37): the app's Gradle configuration now gets past
:video_thumbnailcleanly with this change (confirmed by the jcenter/plugin-application errors disappearing from the build log; the app hit an unrelated compileSdk-minor-version issue afterwards, tracked separately).I'm also considering PR #196 and #190 (both replace
jcenter()withmavenCentral()without removing the rest of the legacy buildscript block) — this PR is a superset that also fixes the AGP-classpath androotProject.allprojectsside effects those don't address.Action items
No action items.
🤖 Generated with Claude Code