Search code examples
androidmavengradlejcentermaven-central

Gradle issue when migrating from JCenter to mavenCentral repository


As you maybe already know, JFrog announced that Bintray, JCenter, GoCenter, and ChartCenter will go down at 1st May this year. Since JCenter is widely used for various dependencies as main repo in Android projects, alternative repo should be used, and I used mavenCentral since it is most popular and widely accepted.

I am facing an issue when migrating from JCenter to mavenCentral. I've kept JCenter also because of realm database (it is planned to be migrated to mavenCentral soon), and some other stuff.

If I put it like this

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

It works as expected, but I want to download just realm and other missing stuff from JCenter until it is fully migrated. Then it looks like this:

repositories {
    google()
    mavenCentral()
    jcenter() {
        content {
            includeGroup "io.realm"
            includeGroup "org.jetbrains.trove4j"
        }
    }
}

Then there are lots of dependencies marked with fatal error, example:

[Fatal Error] appcenter-analytics-4.1.0.pom:2:3: The markup in the document preceding the root element must be well-formed.

And after that:

Could not resolve all task dependencies for configuration ':app:appNameCompileClasspath'. Could not resolve com.microsoft.appcenter:appcenter-analytics:4.1.0. Required by: project :app > Could not resolve com.microsoft.appcenter:appcenter-analytics:4.1.0. > Could not parse POM http://pay.cards/maven/com/microsoft/appcenter/appcenter-analytics/4.1.0/appcenter-analytics-4.1.0.pom > The markup in the document preceding the root element must be well-formed. Could not resolve com.microsoft.appcenter:appcenter-crashes:4.1.0.

I tried various stuff, cleaning the cache, rebuilding the project, lowering dependency versions etc.

Did someone face an issue like this and knows what could be the solution?


Solution

  • According to this and a note here of (both links to the official Microsoft Documentation) it seems to me, that at least your appcenter dependency should have been migrated to mavenCentral() by now. The time your question was asked and the time this issue has been raised lead me to believe that at the time you asked the question, this hasn't already been the case.

    If you still have other dependencies that cannot be resolved, I'd advise you to research if the are still only availabel on JCenter.