关于 Error:Error converting bytecode to dex 异常


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.

 

解决办法:
A:存在依赖包冲突;(找到并删掉;一般情况如果主项目 和 依赖项目中 都有的话;弃掉主项目 中的那个。)
B:尝试Clean 一下项目;

C.

android {
   defaultConfig {
        ...        
        jackOptions {
            enabled true
        }
    }
    dexOptions {
        incremental true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM