This is caused by library dependencies that have been compiled using Java 8 or above.
This is caused by library dependencies that have been compiled using Java 8 or above.
发布Java Library 开源库后,在项目中使用,出现以下错误
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
需在Java Library 中的 build.gradle 添加
apply plugin: 'java'
//添加开始
sourceCompatibility = 1.7
targetCompatibility = 1.7
//添加结束
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
然后重新发布后,即可
还没有评论,来说两句吧...