Warning:The Jack toolchain is deprecated Android s

2019-04-12 09:01发布

I updated my android studio to version 3.0, I was using jackOption in previous version of studio. After update this warning comes. I got this warning. But i don't know where to add these two lines suggested?

Warning:The Jack toolchain is deprecated and will not run. To enable support for Java 8 language features built into the plugin, remove 'jackOptions { ... }' from your build.gradle file, and add

    android.compileOptions.sourceCompatibility 1.8
    android.compileOptions.targetCompatibility 1.8

Future versions of the plugin will not support usage of 'jackOptions' in build.gradle.
To learn more, go to https://d.android.com/r/tools/java-8-support-message.html

1条回答
等我变得足够好
2楼-- · 2019-04-12 09:33

Steps 1: Open your build.gradle (module app)

Steps 2: Add below lines under android block like

android {
    //.. other code
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

Step 3 : synch project or click sync now(appear on right top corner)

Note : if you have jackOptions in build.gradle(module)

defaultConfig {
    jackOptions {
        enabled true
    }
}

then remove jackOptions Block


You can also do it via select

File -> Project structure

Select app->Properties and choose java 8 as compatibility as

enter image description here

查看更多
登录 后发表回答