Skip to content

[BUG][JAVA] Build fails because com.android.tools.build:gradle missing from JCenter #1652

Closed
@tobymurray

Description

@tobymurray
Description

At some point this weekend, com.android.tools.build:gradle went missing from JCenter. Artifacts are generally not expected to be removed from repositories. It may come back before this gets looked at, but it's not there right now. This means any Gradle project that declares a dependency on it, e.g. Java or okhttp-gson (not complete list) will fail.

This manifests as something that looks like:

     [exec] > Could not resolve all dependencies for configuration ':classpath'.
     [exec]    > Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of com.android.tools.build:gradle are available.
     [exec]      Searched in the following locations:
     [exec]          https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml
     [exec]          https://jcenter.bintray.com/com/android/tools/build/gradle/

when Gradle is invoked in one of these projects.

openapi-generator version

3.3.3

OpenAPI declaration file content or url

Doesn't matter, can use https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml

Command line used for generation

java -jar openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java -o output-directory

Steps to reproduce

Invoke the command above to generate a project, then invoke gradlew assemble in the generated project

Suggest a fix
  • change the version of the dependency to one that exists in jcenter
  • change to a repository that does have the artifact

Workaround:

I've changed from using jcenter to Maven - no idea if that's a workable approach more holistically, and is predicated on the maven repository being more stable than jcenter (which I can't back up).

A second workaround would be to introduce more conditionals to exclude all Android dependencies from non-Android projects. This would likely make sense regardless, and would not actually fix the problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions