导入一同事新建的项目,AndroidStudio3.0上建的,然后我的IDE是2.3.3,导入项目后运行异常。
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.
原因是因为2.3.3默认是JDK1.7。解决方法如图。
本文介绍了解决Android Studio不同版本间项目兼容性问题的方法。主要针对从Android Studio 3.0导入到2.3.3版本时遇到的错误:Dex无法解析版本52的字节码。原因是依赖库使用了Java 8或更高版本编译。解决方案是在build.gradle文件中设置targetCompatibility和sourceCompatibility为'1.7'。
855

被折叠的 条评论
为什么被折叠?



