Android Studio 2.1 Error converting bytecode to dex

后端 未结 3 1040
谎友^
谎友^ 2020-12-15 11:29

I am getting the following error since I updated the android studio from 2.0 to 2.1.

Error:Error converting bytecode to dex:

Cause: Dex ca

3条回答
  •  长情又很酷
    2020-12-15 11:36

    Possibile duplicate of Android: Dex cannot parse version 52 byte code. The most quoted answer solved the problem for me.
    I added compileOptions and jackOptions as shown below to my build.gradle to use JDK 1.8.

    android {
        ...
        defaultConfig {
            ...        
            jackOptions {
                enabled true
            }
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }
    

提交回复
热议问题