Skip to content

引入库后编译报错:Reason: IllegalArgumentException, message: Unsupported class file major version 61. #365

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

Open
superoidlau opened this issue May 8, 2025 · 0 comments

Comments

@superoidlau
Copy link

` What went wrong:
Execution failed for task ':app:mergeDebugResources'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform CheckVersionLib-2.4.2.aar (com.github.AlexLiuSheng:CheckVersionLib:2.4.2) to match attributes {artifactType=android-res, org.gradle.category=library, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
> Execution failed for JetifyTransform: F:\AsData.gradle\caches\modules-2\files-2.1\com.github.AlexLiuSheng\CheckVersionLib\2.4.2\e32ae4ff4c1583629b08ae11aa0630c68b180220\CheckVersionLib-2.4.2.aar.
> Failed to transform 'F:\AsData.gradle\caches\modules-2\files-2.1\com.github.AlexLiuSheng\CheckVersionLib\2.4.2\e32ae4ff4c1583629b08ae11aa0630c68b180220\CheckVersionLib-2.4.2.aar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 61. (Run with --stacktrace for more details.)
Suggestions:
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
`

引入库后项目编译报错:
AGP:3.6.4
gradle:gradle-6.3-all
java版本:11

开启了:
android.useAndroidX=true
android.enableJetifier=true

主要的错误原因:
Reason: IllegalArgumentException, message: Unsupported class file major version 61. (Run with --stacktrace for more details.)

issuetracker上的解决方案说是将enableJetifier去掉或者设为false,但是这样做不可行。

因此有其他方法解决此问题吗?

@superoidlau superoidlau changed the title Reason: IllegalArgumentException, message: Unsupported class file major version 61. 引入库后编译报错:Reason: IllegalArgumentException, message: Unsupported class file major version 61. May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant