“没有缓存的版本...可用于脱机模式." [英] "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
版本版本:0.9.1
Gradle version: 0.9.1
我正在使用与Internet的代理连接.
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设置
或在OSX中:
首选项->等级->全局Gradle设置
或更新版本:
文件->设置->构建,执行,部署->构建工具-> 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屋!