Zaid Kajee Zaid Kajee - 1 year ago 170
Android Question

Android Studio Error:Gradle DSL method not found: 'has()'

After latest update of android studio , using classpath '' , I am getting the following error on gradle sync .

Error:Gradle DSL method not found: 'has()'

Any ideas

Update its casused by android volley , full error :

Error:FAILURE: Build failed with an exception.

  • Where:
    Script 'D:\APPS-MOBI**\Android\volley\bintray.gradle' line: 64

  • What went wrong:
    A problem occurred evaluating script.

    Could not find method has() for arguments [release] on project ':volley' of type org.gradle.api.Project.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Answer Source

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")


publish = project.hasProperty("release")

Seems to fix the issue

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download