關於 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