运行flutter app报错WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'varia

运行flutter app报错WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'. 

新建第一个flutter项目运行时报错提示getJavaCompile方法过期,提示如下:

WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Affected Modules: asyncokhttp

但是我项目里面没有用到这个方法,百度上说了很多问题,想什么gradle版本不对,同步下载不了依赖库,要改镜像下载啥的,都试了,都没用,最后在stackoverflow看到一个回答:

https://stackoverflow.com/questions/52470044/warning-api-variant-getjavacompile-is-obsolete-and-has-been-replaced-with?r=SearchResults

后面有一个回答是提到Kotlin版本问题,将Kotlin版本由1.2.71升级到1.3.50就可以了,按照他的回答,升级Kotlin后果然可以正常运行了。

 

大家遇到的问题可能不一样,可以看下stackoverflow上面的其他回答

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值