我刚刚将我的 Android Studio 从 1.5 升级(即安装了一个全新版本)到 2.0。升级似乎很顺利,但是当我打开项目时,当 Gradle 正在同步我的项目时,我遇到了问题。
在 Gradle 同步运行几分钟后,我收到此错误:
Failed to sync Gradle project MyProject
Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle.
Error: Enable Gradle "offline mode' and sync project
Learn about configuring HTTP proxies in Gradle
所以,我点击链接,上面写着:
Enable Gradle "offline mode' and sync project
然后 Gradle 旋转了一两秒,我现在收到了这样的信息:
Failed to sync Gradle project MyProject
Error: No cached version of com.android.tools.build:gradle:1.3.0 available for offline mode.
Disable Gradle 'offline mode' and sync project
所以,我点击这个链接:
Disable Gradle 'offline mode' and sync project
我又回到了我的第一个错误。
我正在使用的机器是 100% 离线的。它没有,也永远不会有任何类型的网络连接。我想我需要禁用某种需要互联网的检查,但我不确定是什么。这是可以修复的,还是我必须降级回 Android Studio 1.5?
更新
我也收到此错误消息:
Gradle sync failed: Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle.