google / guava

Google core libraries for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not find error_prone_annotations-2.11.0.jar

praveenkg85 opened this issue · comments

Description

Hello,
I am working on KMM (Kotlin Multiplatform for Mobile) and while upgrading android and common dependencies (kotlin: 1.9.20, Gradle Plugin: 8.1.0), I have encountered a weird issue.

Task failed with an exception.

  • What went wrong:
    Execution failed for task ':shared:extractDebugAnnotations'.

Could not resolve all files for configuration ':shared:detachedConfiguration1'.
Could not find error_prone_annotations-2.11.0.jar (com.google.errorprone:error_prone_annotations:2.11.0).
Searched in the following locations:
../maven/v1/com/google/errorprone/error_prone_annotations/2.11.0/error_prone_annotations-2.11.0.jar

Checked all the dependencies and found this lib is used in com.google.guava:guava:31.1-jre

\--- com.android.tools.utp:android-test-plugin-host-coverage:31.1.2
     +--- com.android.tools:common:31.1.2
     |    +--- com.android.tools:annotations:31.1.2
     |    +--- com.google.guava:guava:31.1-jre
     |    |    +--- com.google.guava:failureaccess:1.0.1
     |    |    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
     |    |    +--- com.google.code.findbugs:jsr305:3.0.2
     |    |    +--- org.checkerframework:checker-qual:3.12.0
     |    |    +--- com.google.errorprone:error_prone_annotations:2.11.0
     |    |    \--- com.google.j2objc:j2objc-annotations:1.3
     |    +--- net.java.dev.jna:jna-platform:5.6.0
     |    |    \--- net.java.dev.jna:jna:5.6.0
     |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20-RC2
     |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.20-RC2
     |         |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.20-RC2
     |         |    \--- org.jetbrains:annotations:13.0
     |         \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.20-RC2
     |              \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.20-RC2 (*)
     +--- com.android.tools.utp:android-test-plugin-host-coverage-proto:31.1.2
     |    \--- com.google.protobuf:protobuf-java:3.19.3
     +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20-RC2 (*)
     +--- com.google.protobuf:protobuf-java:3.19.3
     \--- com.google.testing.platform:android-device-provider-local:0.0.8-alpha08

I have tried to exclude the dependency, enforce the version 2.11.0 or even the latest one 2.24.0, but nothing worked. Please help me resolving the issue.

Thanks
Praveen Gupta

Example

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':shared:extractDebugAnnotations'.
> Could not resolve all files for configuration ':shared:detachedConfiguration1'.
   > Could not find error_prone_annotations-2.11.0.jar (com.google.errorprone:error_prone_annotations:2.11.0).
     Searched in the following locations:
         ../maven/v1/com/google/errorprone/error_prone_annotations/2.11.0/error_prone_annotations-2.11.0.jar

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':shared:extractReleaseAnnotations'.
> Could not resolve all files for configuration ':shared:detachedConfiguration1'.
   > Could not find error_prone_annotations-2.11.0.jar (com.google.errorprone:error_prone_annotations:2.11.0).
     Searched in the following locations:
         ../maven/v1/com/google/errorprone/error_prone_annotations/2.11.0/error_prone_annotations-2.11.0.jar

* 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.
==============================================================================

BUILD FAILED in 2m 40s
55 actionable tasks: 21 executed, 21 from cache, 13 up-to-date

Expected Behavior

Dependencies should be resolved without any error.

Actual Behavior

Execution failed for task ':shared:extractReleaseAnnotations'.

Could not resolve all files for configuration ':shared:detachedConfiguration1'.
Could not find error_prone_annotations-2.11.0.jar (com.google.errorprone:error_prone_annotations:2.11.0).

Packages

No response

Platforms

Android, Java 17

Checklist

You'll probably want to try https://stackoverflow.com/. My guess is that there is something specific about your configuration that is preventing Gradle from finding the jar. Based on the name "detachedConfiguration," I wonder if the build is configured to not download jars from Maven Central. If so, then you'll need to either let it download from Maven Central, download the jar you need yourself (and put it in ../maven/v1/com/google/errorprone/error_prone_annotations/2.11.0/, presumably), or force Gradle to use a version that you do have downloaded (which you may be able to identify by looking at which directories exist in ../maven/v1/com/google/errorprone/error_prone_annotations/). I would also have expected for excluding the dependency to work, so I'd suggest including how you tried to do that and what the results were when you ask on Stack Overflow.