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

}

即可!

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容