“没有缓存版本……可用于离线模式." [英] "No cached version... available for offline mode."
问题描述
我在 Android Studio 中构建新的 Hello World 项目时收到一条错误消息:
I received an error message while building a new Hello World project in Android Studio:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'MyApplication2'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:0.9.1.
Required by:
:MyApplication2:unspecified
> No cached version of com.android.tools.build:gradle:0.9.1 available for offline mode.
BUILD FAILED
Android Studio 版本:0.5.2
Android Studio version: 0.5.2
Gradle 版本:0.9.1
Gradle version: 0.9.1
我使用代理连接到互联网.
I'm using a proxy connection to Internet.
推荐答案
今天更新 Android Studio 后出现同样的错误.对我来说,这不是代理设置的问题:
Had the same error after updating Android Studio today. For me, it wasn't a matter of proxy settings:
在 Android Studio 0.6.0 中取消选中离线工作":
Uncheck "Offline work" in Android Studio 0.6.0:
文件->设置->Gradle->全局Gradle设置
或在 OSX 中:
Preferences->Gradle->Global Gradle Setting
或更新的版本:
文件->设置->构建、执行、部署->构建工具->Gradle
重新同步项目,例如通过重新启动 Android Studio
Resync the project, for example by restarting the Android Studio
(仅在 Gradle 0.11 版...和 Android Studio 0.6.0 预览版中测试)
(Only tested in Gradle version 0.11... and Android Studio version 0.6.0 Preview)
为不同版本/平台添加了路径(如John Ballinger 和The_Martian 所述).尚未验证.
EDIT : Added paths for different versions/platforms (as mentioned by John Ballinger and The_Martian). Not yet verified.
这篇关于“没有缓存版本……可用于离线模式."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!