在Android Studio中创建项目时出错

时间:2013-07-21 21:28:41

标签: android

每当我尝试在Android中制作新项目时,都会收到此错误

Failed to import Gradle project: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
       Build file 'C:\Users\vvina_000\AndroidStudioProjects\MyApplicationProject\MyApplication\build.gradle' line: 9
       A problem occurred evaluating project ':MyApplication'.
       A problem occurred evaluating project ':MyApplication'.
       Could not create plugin of type 'AppPlugin'.
       com.google.common.collect.Maps
       Consult IDE log for more details (Help | Show Log)       

我打开了build.gradle文件,所有内容都是:
// Top-level build file where you can add configuration options common to all sub-projects/modules", there is no line 9.

1 个答案:

答案 0 :(得分:0)

最近有同样的问题。 解决方法是删除Gradle并重置AndroidStudio: (OSX Mountain Lion)

  1. 显示隐藏文件
    在终端执行:默认写com.apple.Finder AppleShowAllFiles是 重新启动Finder(选项+右键单击Finder>重新启动)
  2. 删除gradle文件:
    〜/ .gradle
  3. 重置AndroidStudio
    在/ Application / Android Studio.app/bin/idea.properties中添加行:  idea.config.path =〜/ .AndroidStudioPreview /配置
     idea.system.path =〜/ .AndroidStudioPreview /系统
  4. 重启AndroidStudio。
  5. 然后一切都像魅力一样:D