Skip to content

fix(android): replace removed jcenter() with mavenCentral()#31

Open
Michael-Betclic wants to merge 1 commit into
BrowserStackCE:mainfrom
Michael-Betclic:fix/jcenter-to-mavencentral
Open

fix(android): replace removed jcenter() with mavenCentral()#31
Michael-Betclic wants to merge 1 commit into
BrowserStackCE:mainfrom
Michael-Betclic:fix/jcenter-to-mavencentral

Conversation

@Michael-Betclic

Copy link
Copy Markdown

Problem

android/build.gradle declares jcenter() in both the buildscript and allprojects repository blocks. Gradle 9 removed jcenter() (it was only deprecated through Gradle 8.x), so any project that evaluates this plugin under Gradle 9 fails:

* What went wrong:
A problem occurred evaluating project ':flutter_system_proxy'.
> Could not find method jcenter() for arguments [] on repository container ...

This surfaces as soon as a consuming app upgrades its Android toolchain to Gradle 9 (e.g. via a newer Flutter SDK that regenerates the Gradle wrapper).

Fix

Replace both jcenter() calls with mavenCentral(). JCenter has been sunset (read-only since early 2022), and the artifacts these blocks need are available on Maven Central, so this is a safe, behaviour-preserving swap that also works on Gradle 8.x.

     repositories {
         google()
-        jcenter()
+        mavenCentral()
     }

No other changes.

Gradle 9 removed the jcenter() repository shorthand (it was only deprecated
through Gradle 8.x). Building this plugin on Gradle 9 now fails at project
evaluation with "Could not find method jcenter()". Swap both repository
blocks (buildscript + allprojects) to mavenCentral(), which serves the same
artifacts (JCenter is sunset/read-only).
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants