今天使用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