问题描述
当我尝试建立在Android Studio中的一个项目,我得到这个错误:
编辑在9秒内完成,1错误,0警告
1个错误
0警告
org.gradle.tooling.GradleConnectionException:无法安装摇篮分配从http://services.gradle.org/distributions/gradle-1.6-bin.zip:无法从HTTP安装摇篮分布://服务。 gradle.org/distributions/gradle-1.6-bin.zip。
我能做些什么来解决这个问题?
更新:
当我看错误日志,我看到这样的:
org.jetbrains.plugins.gradle.settings.GradleSettings不能转换到org.jetbrains.plugins.gradle.settings.GradleSettings:
org.jetbrains.plugins.gradle.settings.GradleSettings不能转换为org.jetbrains.plugins.gradle.settings.GradleSettings
请阅读日志的:
- 在Microsoft Windows上:
[Windwos的驱动器] \ Documents和Settings \ [用户名] \。AndroidStudio preVIEW \ SYSTEM \日志
- 在Mac和Linux:
〜/ .AndroidStudio preVIEW /系统/日志/
和你会发现 gradle-1.6-bin.zip
的TMP下载路径。例如,我的是:
2013年5月17号09:42:16934 [283002] INFO - ution.rmi.RemoteProcessSupport - 解压缩C:\ Documents和Settings\Kiki.J.Hu\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\gradle-1.6-bin.zip到C:\ Documents和Settings \ Kiki.J.Hu \ .gradle \包装\ dists中\摇篮-1.6-BIN \ 72srdo3a5eb3bic159kar72vok
...
致:com.intellij.openapi.externalSystem.model.ExternalSystemException:无法从http://services.gradle.org/distributions/gradle-1.6-bin.zip安装摇篮分布。
java.util.zip.ZipException:错误开幕zip文件
于是,我知道了原因:我下载了一个不完整的ZIP包
。然后,我从 http://services.gradle.org/distributions/gradle-1.6-bin.zip
手动下载完整的ZIP包并复制此ZIP包:
- 的Windows:
C:\ Documents和设置\ Kiki.J.Hu \ .gradle \包装\ dists中\摇篮-1.6-BIN \ 72srdo3a5eb3bic159kar72vok \
- 在Mac OS X上:
〜/ .gradle /包装/ dists中/摇篮-1.10-所有/ 6vpvhqu0efs1fqmqr2decq1v12 /
现在一切正常。
When I try to build a project on Android Studio, I get this error:
Compilation completed with 1 error and 0 warnings in 9 sec
1 error
0 warnings
org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
What can I do to fix it?
UPDATE:
When I look at the Error Log, I saw this:
org.jetbrains.plugins.gradle.settings.GradleSettings cannot be cast to org.jetbrains.plugins.gradle.settings.GradleSettings:
org.jetbrains.plugins.gradle.settings.GradleSettings cannot be cast to org.jetbrains.plugins.gradle.settings.GradleSettings
Please read the log from:
- On Microsoft Windows:
[Windwos Drive]\Documents and Settings\[your username]\.AndroidStudioPreview\system\log
- On Mac and Linux:
~/.AndroidStudioPreview/system/log/
And you will find the tmp download path of gradle-1.6-bin.zip
. For example, mine is:
2013-05-17 09:42:16,934 [ 283002] INFO - ution.rmi.RemoteProcessSupport - Unzipping C:\Documents and Settings\Kiki.J.Hu\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\gradle-1.6-bin.zip to C:\Documents and Settings\Kiki.J.Hu\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok
...
Caused by: com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
java.util.zip.ZipException: error in opening zip file
So I know the cause: I downloaded an incomplete ZIP package.
Then I downloaded the full ZIP package from http://services.gradle.org/distributions/gradle-1.6-bin.zip
manually and copied this ZIP package to:
- Windows:
C:\Documents andSettings\Kiki.J.Hu\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\
- Mac OS X:
~/.gradle/wrapper/dists/gradle-1.10-all/6vpvhqu0efs1fqmqr2decq1v12/
Everything is OK now.
这篇关于Android的工作室错误安装摇篮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!