根據(jù)最新文檔
將 Android Studio 升級至 3.0.0 或更高版本憎账,去掉下面的配置
defaultConfig.jackOptions.enabled = true
或者
jackOptions {
enabled true
}
所以整體配置如下:
android {
...
// Configure only for each module that uses Java 8
// language features (either in its source code or
// through dependencies).
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}