AndroidStudio 配置java1.8 lambda

android studio 3.0.1从java jdk1.7升级到1.8版本的时候,出现以下警告:

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

原来build.gradle的配置是这样的 :

defaultConfig {

   jackOptions {

      enabled true

   }

   compileOptions {

      sourceCompatibility JavaVersion.VERSION_1_8

      targetCompatibility JavaVersion.VERSION_1_8

   }

}

只需要删除:

jackOptions {

   enabled true

}

即可!

你可能感兴趣的:(AndroidStudio 配置java1.8 lambda)