解决 Error:Jack is required to sup

作者: ReadyShow | 来源:发表于2018-09-04 09:30 被阅读5次

在AS 2.1中使用 Lambda 时 会出现

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

解决方法

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        jackOptions {
            enabled true
        }

    }

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

加入jackOptions

加入compileOptions

就可以使用Lambda表达式

相关文章

网友评论

    本文标题:解决 Error:Jack is required to sup

    本文链接:https://www.haomeiwen.com/subject/blgiwftx.html