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

Gradle build fails with sentry-bom 7.10.0 after updating from 7.9.0 #3502

Closed
Saphri opened this issue Jun 21, 2024 · 1 comment
Closed

Gradle build fails with sentry-bom 7.10.0 after updating from 7.9.0 #3502

Saphri opened this issue Jun 21, 2024 · 1 comment
Labels
Platform: Java Type: Bug Something isn't working

Comments

@Saphri
Copy link

Saphri commented Jun 21, 2024

Integration

sentry-okhttp

Java Version

21

Version

7.10.0

Steps to Reproduce

Use a simpel gradle.build file

plugins {
    id 'java'
    id 'io.sentry.jvm.gradle' version '4.8.0'
}

group = 'org.saphri.sentry'
version = '0.0.1-SNAPSHOT'

java {
  sourceCompatibility = JavaVersion.VERSION_21
}

repositories {
    mavenCentral()
}

dependencies {
    implementation platform('io.sentry:sentry-bom:7.10.0')

    implementation 'io.github.openfeign:feign-okhttp:13.2.1'
    implementation 'io.sentry:sentry-openfeign'
}

test {
    useJUnitPlatform()
}

If I downgrade the sentry-bom to 7.9.0 the build is ok

Expected Result

build should work

Actual Result

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve io.sentry:sentry-android-okhttp:7.10.0.
     Required by:
         project : > io.sentry:sentry-bom:7.10.0
         project : > io.github.openfeign:feign-okhttp:13.2.1 > com.squareup.okhttp3:okhttp:4.12.0
      > No matching variant of io.sentry:sentry-android-okhttp:7.10.0 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 21, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
          - Variant 'releaseVariantReleaseApiPublication' declares a library for use during compile-time, and its dependencies declared externally:
              - Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, preferably in the form of class files
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 21)
          - Variant 'releaseVariantReleaseRuntimePublication' declares a library for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, preferably in the form of class files
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 21)

The dependency io.sentry:sentry-android-okhttp:7.10.0 seems to have introduced a .module file that gradle uses.. this file was not present in the 7.9.0 release of that library (or any previous releases).

See https://repo1.maven.org/maven2/io/sentry/sentry-android-okhttp/7.10.0/

@romtsn
Copy link
Member

romtsn commented Jun 23, 2024

hi @Saphri thanks for the report, I believe this issue will be fixed with the next release of the gradle plugin, this is the PR that fixes it getsentry/sentry-android-gradle-plugin#724. We'll now auto-install sentry-okhttp instead of sentry-android-okhttp, therefore the pure JVM projects should not fail anymore due to the aar dependency.

I'll keep you posted when we ship the new gradle plugin version, but meanwhile closing this as resolved by
getsentry/sentry-android-gradle-plugin#724

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Java Type: Bug Something isn't working
Projects
Archived in project
Archived in project
Development

No branches or pull requests

2 participants