0

每当我尝试在 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.

4

1 回答 1

0

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

  1. 显示隐藏文件
    在终端中执行:默认写入 com.apple.Finder AppleShowAllFiles YES 重启 Finder(Option+RightClick on Finder > Relaunch)
  2. 删除 gradle 文件:
    ~/.gradle
  3. 重置 AndroidStudio
    在 /Application/Android Studio.app/bin/idea.properties 添加行:idea.config.path=~/.AndroidStudioPreview/config
    idea.system.path=~/.AndroidStudioPreview/system
  4. 重启安卓工作室。

然后一切都像魅力一样:D

于 2013-11-20T21:26:51.220 回答