Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompa

来源:互联网 发布:北京中科院理化所知乎 编辑:程序博客网 时间:2024/05/23 01:21

今天在AS里面添加支持jdk1.8版本,

android {
compileOptions{           sourceCompatibility JavaVersion.VERSION_1_8       targetCompatibility JavaVersion.VERSION_1_8}
 }

出现如下错误:

Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8.

Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8.


成功解决:

我的AS是2.3.3在defaultConfig中添加蓝色部分即可

defaultConfig {
        applicationId "com.xxx"
        minSdkVersion 19
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
       jackOptions {
            enabled true
        }

}


参考博客

http://blog.csdn.net/fullstackdeveloper/article/details/52701707


阅读全文
0 0