Error_Error converting bytecode to dex_ Cause_ Dex cannot parse version 52 byte code.

2023-05-16

报错:

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.

解决办法:在app的gradle里添加如下两个语句

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        //添加
        dexOptions {
            preDexLibraries false
            jumboMode true
            javaMaxHeapSize "2g"
            incremental false
        }
    }
    //添加
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Error_Error converting bytecode to dex_ Cause_ Dex cannot parse version 52 byte code. 的相关文章

随机推荐