使用导入AndroidStudio导入Volley后报错:Error:Gradle DSL method not found: 'has()',的解决方式

今天使用Volley时在AndroidStudio中导入VolleyModule,然后就看到As的左下侧报这样的错误:Error:Gradle DSL method not found: 'has()'

原因是:

has()方法已经不赞成使用了,并且计划从Grandle3.0中移除,使用 hasProperty() 或 ext.has() 方法代替。

Changing the line in Volley's bintray.gradle file from

修改Volley 的bintray.gradle 文件中的这行代码:

publish = project.has("release")

publish = project.hasProperty("release")

问题就解决了。


翻译自:https://stackoverflow.com/questions/41237629/android-studio-errorgradle-dsl-method-not-found-has

The Volley project has given the following warning for a while now:

The has() method has been deprecated and is scheduled to be removed in Gradle 3.0. Please use the hasProperty() or ext.has() method instead.

Changing the line in Volley's bintray.gradle file from

publish = project.has("release")

to

publish = project.hasProperty("release")

Seems to fix the issue




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值