Skip to content

Move android project repositories away from JCenter #78338

@jonahwilliams

Description

@jonahwilliams

JCenter is going to be sunsetted sometime in early 2022. In order to keep our CI and newly created Android projects building, we need to migrate the Gradle repositories to mavenCentral.

Unfortunately not all of the artifacts we use appear to be uploaded to mavenCentral, so we're going to need to update some versions first.

To repro update the build.gradle config and try to build an APK.

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

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}


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

This results in:

FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
A problem occurred configuring root project 'android'.                  
> Could not resolve all artifacts for configuration ':classpath'.       
   > Could not find org.jetbrains.trove4j:trove4j:20160824.             
     Searched in the following locations:                               
       - https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
       - https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
     Required by:                                                       
         project : > com.android.tools.build:gradle:4.1.0 > com.android.tools.build:builder:4.1.0 > com.android.tools:sdk-common:27.1.0
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org       

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: contributor-productivityTeam-specific productivity, code health, technical debt.c: tech-debtTechnical debt, code quality, testing, etc.platform-androidAndroid applications specificallyteam-infraOwned by Infrastructure teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions