Skip to content

Unsupported class file major version 68 of version 1.17.0 on Android #1763

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

Closed
anonyein opened this issue Feb 1, 2025 · 5 comments
Closed
Assignees
Labels

Comments

@anonyein
Copy link

anonyein commented Feb 1, 2025

* What went wrong:
Execution failed for task ':app:checkArm64WithPyReleaseDuplicateClasses'.
> Could not resolve all files for configuration ':app:arm64WithPyReleaseRuntimeClasspath'.
   > Failed to transform byte-buddy-1.17.0.jar (net.bytebuddy:byte-buddy:1.17.0) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for JetifyTransform: C:\Users\****\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.17.0\9724799eac8d1b3f2de4ff6a27a34fa8b1628ac1\byte-buddy-1.17.0.jar.
         > Jetifier failed to transform: C:\Users\****\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.17.0\9724799eac8d1b3f2de4ff6a27a34fa8b1628ac1\byte-buddy-1.17.0.jar
           The error was: java.lang.IllegalArgumentException - Unsupported class file major version 68
           To fix this issue, see https://issuetracker.google.com/issues/184622491

This also happens from the version of 1.16.0

@dondonz
Copy link

dondonz commented Feb 1, 2025

Hello, I have also seen the same message, starting from 1.16.0 and also present in 1.17.0.

My use case is different to the original poster, I am a maintainer of GraphQL Java and we use Byte Buddy for a special agent jar. We shade in Byte Buddy, and something goes awry, with the error "Unsupported class file major version 68". See an example build: https://github.com/graphql-java/graphql-java/actions/runs/12934658930/job/36076178664. We use Java 11, so it's strange to see an error referencing Java 24 (version 68).

I ended up downgrading to ByteBuddy version 1.15.11, which did not have any errors. This is the PR to revert the change. If you revert this, you can reproduce the error: https://github.com/graphql-java/graphql-java/pull/3799/files

I'm not very familiar with multi-release JARs. Is it possible some change between 1.15.11 and 1.16.0 has caused this unusual class issue?

Thanks for all the excellent work you do in maintaining this library!

@anonyein
Copy link
Author

anonyein commented Feb 1, 2025

Hello, I have also seen the same message, starting from 1.16.0 and also present in 1.17.0.

My use case is different to the original poster, I am a maintainer of GraphQL Java and we use Byte Buddy for a special agent jar. We shade in Byte Buddy, and something goes awry, with the error "Unsupported class file major version 68". See an example build: https://github.com/graphql-java/graphql-java/actions/runs/12934658930/job/36076178664. We use Java 11, so it's strange to see an error referencing Java 24 (version 68).

I ended up downgrading to ByteBuddy version 1.15.11, which did not have any errors. This is the PR to revert the change. If you revert this, you can reproduce the error: https://github.com/graphql-java/graphql-java/pull/3799/files

I'm not very familiar with multi-release JARs. Is it possible some change between 1.15.11 and 1.16.0 has caused this unusual class issue?

Thanks for all the excellent work you do in maintaining this library!

android.jetifier.ignorelist=byte-buddy-1.17.0.jar
add this to your gradle.properties, which maybe leads to some other bugs that has not been found.

in the jar there are java24 version class files
try to download the jar file and delete "byte-buddy-1.17.0.jar\META-INF\versions\24"
https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy/1.17.0/byte-buddy-1.17.0.jar

@anonyein anonyein closed this as completed Feb 1, 2025
@raphw
Copy link
Owner

raphw commented Feb 1, 2025

As spelled out, this is integration with the class file API which requires Java 24 API. This is therefore kept in a version-specific folder, but it seems that the tool in question does not respect this.

@raphw raphw self-assigned this Feb 1, 2025
@raphw raphw added the question label Feb 1, 2025
@dondonz
Copy link

dondonz commented Feb 1, 2025

I appreciate I'm talking about an unusual edge case. I'm not using Android as the other commenter is, I am using the Gradle Shadow plugin to shade in Byte Buddy.

I saw a similar thread on the Jackson repo about a similar issue between Shadow and Jackson's multi-release JAR setup. FasterXML/jackson-core#1210 I thought I'd post here in case there's any change since 1.15.11 that may have changed behaviour, but I understand it may also be something about the Gradle plugin getting confused about the Java version.

@dondonz
Copy link

dondonz commented Feb 2, 2025

Hello, closing out the thread, the issue was with one of Shadow's dependencies, jdependency, which had not yet supported Java 24. New releases for these libraries happened today, so this issue should be fixed for everyone. Thanks! GradleUp/shadow#1220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants