android 关闭jack_java – 警告:Jack工具链已弃用Android工作室

我将我的android工作室更新到3.0版本,我在之前版本的工作室中使用了jackOption.更新后出现此警告.我收到了这个警告.但我不知道在哪里添加这两行建议?

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

解决方法:

第1步:打开build.gradle(模块应用)

第2步:在android块下添加以下行

android {

//.. other code

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8

targetCompatibility JavaVersion.VERSION_1_8

}

}

第3步:同步项目或立即点击同步(显示在右上角)

注意:如果你在build.gradle(模块)中有jackOptions

defaultConfig {

jackOptions {

enabled true

}

}

然后删除jackOptions块

您也可以通过选择来完成

档案 – >项目结构

选择app-> Properties并选择java 8作为兼容性

标签:java,android,java-8,android-gradle,build-gradle

来源: https://codeday.me/bug/20190716/1474230.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值