Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guava checks ignore dependencies resolution that may bump guava to higher version #1307

Open
Jacks0N23 opened this issue Nov 13, 2024 · 2 comments
Labels
bug Something isn't working more information needed

Comments

@Jacks0N23
Copy link

Plugin version
2.4.2

Gradle version
8.11

JDK version
17

(Optional) Kotlin and Kotlin Gradle Plugin (KGP) version
2.0.21

(Optional) Android Gradle Plugin (AGP) version
8.7.2.

Describe the bug
I cannot even configure project with latest version which include guava version check.
Plugin says:

The Dependency Analysis Gradle Plugin requires Guava 33.1.0 or higher. Your build is using Guava 32.1.3-jre,
which is too low. Please update your dependencies.

Guava was loaded in the classloader named

    ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:](export)}

But when I print deps to understand from where I got wrong guava version I saw this:

+--- androidx.build.gradle.gcpbuildcache:androidx.build.gradle.gcpbuildcache.gradle.plugin:1.0.0
|    \--- androidx.build.gradle.gcpbuildcache:gcpbuildcache:1.0.0
|         +--- com.squareup.okhttp3:okhttp-bom:4.12.0
|         |    \--- com.squareup.okhttp3:okhttp:4.12.0 (c)
|         +--- com.google.cloud:google-cloud-storage:2.30.1
|         |    +--- com.google.guava:guava:32.1.3-jre -> 33.1.0-jre
|         |    +--- com.google.guava:failureaccess:1.0.1
|         |    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava

To Reproduce
Idk minimal example, but my project looks similar to this

  1. composite build with two modules:
    1.1 . build-logic-settings -> :build-logic-settings:build-cache -> implementation("androidx.build.gradle.gcpbuildcache:androidx.build.gradle.gcpbuildcache.gradle.plugin:1.0.0")
    1.2 build-logic -> :build-logic:plugins -> implementation("com.autonomousapps:dependency-analysis-gradle-plugin:2.4.2")
    1.3 try to bump guava here to at least 33.1.0 like implementation("com.google.guava:guava:33.1.0-jre")
  2. Try to sync
  3. You should get the same error

I found the only way to fix - to add implementation("com.google.guava:guava:33.1.0-jre") before lib that require guava. But it's even another composite project, it seems irrational, but my be I'm wrong

Expected behavior
DAGP do not fails fast

@Jacks0N23
Copy link
Author

Maybe you should call checkGuava() only when it's required to call any task, not while configuration?

@autonomousapps autonomousapps added bug Something isn't working more information needed labels Nov 13, 2024
@autonomousapps autonomousapps added this to the next milestone Nov 13, 2024
@autonomousapps
Copy link
Owner

Thanks for the issue! Could you please provide a minimal reproducer?

@autonomousapps autonomousapps removed this from the next milestone Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working more information needed
Projects
None yet
Development

No branches or pull requests

2 participants