Warning:The Jack toolchain is deprecated Android studio

前提是你 提交于 2019-12-12 08:57:59

问题


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:


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



来源:https://stackoverflow.com/questions/47150611/warningthe-jack-toolchain-is-deprecated-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!