Unsupported method: GradleProject.getBuildScript()

前端 未结 1 642
误落风尘
误落风尘 2021-02-12 23:12

I am getting this error while importing an adt project(after exporting and creating gradle file) into Android Studio on mac os x.

The android-studio version is 3.6 (late

相关标签:
1条回答
  • 2021-02-12 23:32

    I was getting a similar error today opening a project after upgrading to Android Studio 0.3.6. Here is what I had to change to get it working again for me.

    • Changed the following line in gradle-wrapper.properties from gradle-1.6-bin.zip to gradle-1.8-bin.zip

    distributionUrl=http://services.gradle.org/distributions/gradle-1.8-bin.zip

    • Also changed the following line in build.gradle from 0.5.+ to 0.6.+

    classpath 'com.android.tools.build:gradle:0.6.+'

    In Windows, gradle-wrapper.properties is located at \project folder\gradle\wrapper\gradle-wrapper.properties

    build.gradle is located at \project folder\module folder\build.gradle

    The Files that Needed changed are highlighted in the project explorer screen shot below.

    Here's a screen shot of the project explorer in Android Studio with the files that need changed highlighted.

    After those changes I sync'd the project with the gradle files and then could build and test.

    Hope that helps.

    Note that you should use default or customizable gradle wrapper: gradle idea settings

    0 讨论(0)
提交回复
热议问题