我导入Google示例samples有问题,能帮看看吗?

Android-studio开发环境正常。已下载samples-21,导入的时候出现一个错误:Error:The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 2.0.0. <a href="http://ask.android-studio.org/ ... 6quot;>Fix plugin version and sync project</a>

上网搜索之后,看到解决方案是修改build.gradle文件的一些配置,可是我导入的示例在build.gradle全是空的,什么都没有。我点击:FIx plugin version and sync project,出现错误:Error:Unable to find method 'org.gradle.api.artifacts.Configuration.setExtendsFrom(Ljava/lang/Iterable;)Lorg/gradle/api/artifacts/Configuration;'.
Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.


看了翻译,但是不知道怎么解决。
2016-04-24 11:37 添加评论 分享
已邀请:

最佳回复

1

不良人 - https://github.io/zhongzilu

赞同来自: ask

  1. 首先先确认是否是由于Gradle下载不完全导致的,你可以尝试新建一个项目来测试,File => New =>New Project
  2. 如果能够创建,就把新创建的项目中的build.gradle以及gradle文件夹整个复制到你要导入的项目中去覆盖
  3. 最后再重新导入你要导入的项目
    4.如果不能创建,你需要翻土啬之后再重新执行步骤1,2,3

要回复问题请先登录注册

退出全屏模式 全屏模式 回复