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

class file has wrong version 61.0, should be 55.0 #147

Open
lotosbin opened this issue Oct 9, 2024 · 5 comments
Open

class file has wrong version 61.0, should be 55.0 #147

lotosbin opened this issue Oct 9, 2024 · 5 comments

Comments

@lotosbin
Copy link
Contributor

lotosbin commented Oct 9, 2024

bad class file: /Users/liubinbin/.gradle/caches/8.9/transforms/f8d78a4480faba36b34bc0e996d2959c/transformed/jetified-component-impl-1.9.6-api.jar(/com/xiaojinzi/component/impl/service/ServiceManager.class)
class file has wrong version 61.0, should be 55.0
Please remove or make sure it appears in the correct subdirectory of the classpath.

compileOptions {
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
    jvmTarget = '11'
}
@xiaojinzi123
Copy link
Owner

你自己的 gradle 那边选择 jdk17 就行了

@lotosbin
Copy link
Contributor Author

lotosbin commented Oct 9, 2024

Android 14才开始支持 jdk17

@xiaojinzi123
Copy link
Owner

Android 14才开始支持 jdk17

不是啊,你编译的 gradle 版本改为 17 就行了,而且我早就升级到17了
并不是 安卓14 才能运行的

@lotosbin
Copy link
Contributor Author

lotosbin commented Oct 9, 2024

jvmTarget = '17'时, 如果使用了jdk17的新特性, 编译不会报错,但是不能保证在低于android14的设备上正常运行,

@lotosbin
Copy link
Contributor Author

lotosbin commented Oct 9, 2024

考虑到向后兼容, 目前没有必要使用jvmTarget = '17', Android15的sdk最低支持 api 24(Android 7, jdk 1.8), jdk11是完全兼容 jdk1.8的, 使用 jvmTarget = '11'更合适

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

2 participants