自从我将 android studio 更新到 2.2.1 以来,我遇到了这个错误。
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.
到目前为止我已经尝试过:
- 清理和构建项目
- 添加“sourceCompatibility =”1.7“ 目标兼容性=“1.7”“ 到 gradle 文件。
谁能建议如何解决这个问题。
最佳答案
您应该使用 JDK 1.8.0_92
你正在得到
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.
然后您可以在 gradle 部分进行如下设置。
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
清理重建。希望这对您有帮助。
为了获得更好的答案,您可以访问Android: Dex cannot parse version 52 byte code
关于java - 将字节码转换为 dex 时出错 :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40107628/