不支持的方法:GradleProject.getBuildScript() [英] Unsupported method: GradleProject.getBuildScript()
问题描述
我收到此错误,导入一个ADT项目在Mac OS X的Android进入工作室(出口和创建文件的gradle后)。
I am getting this error while importing an adt project(after exporting and creating gradle file) into Android Studio on mac os x.
Android的工作室版本是3.6(最新)和gradle这个版本是1.8(最新)。
The android-studio version is 3.6 (latest) and the gradle version is 1.8 (latest).
错误显示为:
不支持的方法:GradleProject.getBuildScript()。的版本
摇篮您连接到不支持该方法。要解决
你可以改变的问题/升级摇篮你的目标版本
连接到。另外,您也可以忽略这个例外,读
从模型中的其他信息。
Unsupported method: GradleProject.getBuildScript(). The version of Gradle you connect to does not support that method. To resolve the problem you can change/upgrade the target version of Gradle you connect to. Alternatively, you can ignore this exception and read other information from the model.
咨询IDE日志详细信息(帮助|显示日志)
Consult IDE log for more details (Help | Show Log)
我不知道在哪里找IDE日志...
I have no idea where to look for IDE logs...
推荐答案
我得到一个类似的错误今天升级至Android工作室0.3.6后打开项目。这里是我不得不改变,以得到它为我工作了什么。
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.
- 改变以下行 gradle-wrapper.properties 从gradle-1.6-bin.zip到gradle-1.8-bin.zip
- 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
distributionUrl=http://services.gradle.org/distributions/gradle-1.8-bin.zip
- 另外从0.5改为下面的行的build.gradle ,+ 0.6,+
- Also changed the following line in build.gradle from 0.5.+ to 0.6.+
类路径com.android.tools.build:gradle:0.6 +
classpath 'com.android.tools.build:gradle:0.6.+'
在Windows中, gradle-wrapper.properties 位于 \\项目文件夹\\ gradle这个\\包装\\ gradle-wrapper.properties
In Windows, gradle-wrapper.properties is located at \project folder\gradle\wrapper\gradle-wrapper.properties
的build.gradle 位于 \\项目文件夹\\模块文件夹\\的build.gradle
这需要改变突出显示在下面的项目资源管理器屏幕截图的文件。
The Files that Needed changed are highlighted in the project explorer screen shot below.
这些变化之后,我同步时间与文件的gradle项目,然后可以构建和测试。
After those changes I sync'd the project with the gradle files and then could build and test.
希望有所帮助。
请注意,你应该使用默认或定制包装的gradle:
Note that you should use default or customizable gradle wrapper:
这篇关于不支持的方法:GradleProject.getBuildScript()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!