Skip to content

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

Merged
samirans89 merged 1 commit into
BrowserStackCE:mainfrom
Michael-Betclic:fix/jcenter-to-mavencentral
Aug 21, 2026
Merged

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

Conversation

@Michael-Betclic

Copy link
Copy Markdown
Contributor

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.

@Rushabhshroff Rushabhshroff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is correct, safe, and necessary.

Review Summary

Aspect Evaluation Details
Correctness ✅ Passed Fixes the breaking Could not find method jcenter() exception under Gradle 9.0+.
Backward Compatibility ✅ Passed Compatible with existing Gradle versions (6.x, 7.x, 8.x, and 9.x+).
Risk Level 🟢 Low Standard swap; Maven Central hosts all required modern build dependencies.

Technical Breakdown

  • Root Cause: JFrog officially shut down resolution services for JCenter. Gradle officially removed the jcenter() shorthand method in Gradle 9.0, turning any project calling it into a fatal build failure.
  • Behavioral Impact: mavenCentral() is the standard modern replacement. Since all modern Android Gradle Plugin (AGP) and standard Flutter build tools host their dependencies on Maven Central, replacing jcenter() with mavenCentral() preserves all existing build behavior while restoring build pipeline compatibility.

Verdict: The PR should be merged as-is.

@samirans89
samirans89 merged commit 72ff5da into BrowserStackCE:main Aug 21, 2026
1 of 2 checks passed
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.

5 participants