2017年底了做完总结,没有特别事情,将所有工具和插件以及三方的SDK都检查和更新了一遍。
java1.7也升级到了1.8 顺便配置一下新的特性lambda
有两种方式
配置流程:
defaultConfig { ..
// one
jackOptions {
enabled true
}
//two
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
不过在我升级AndroidStudio 3.0.1时 gradle 编译时提示警告
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
只用
defaultConfig {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}