我刚刚下载了 Android Studio 1.0RC4,但无法构建任何项目,甚至是新创建的项目。
我得到的错误是:
错误:无法使用 Gradle 分发运行构建操作 'https://services.gradle.org/distributions/gradle-2.2.1-all.zip'.
我可以从浏览器下载 zip,但它在 AS 上不起作用。这是我的 build.gradle 文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0-rc1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
模块构建文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "simple.com.car10"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
我尝试从 cmd 运行 gradle - build ,但收到此错误:
FAILURE: Build failed with an exception.
* What went wrong:
Build file 'C:\Users\Giovanni\uild' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
总时间:3.093秒
JDK:1.8.0_05
当我再次尝试时没有任何反应,我已经尝试卸载所有内容并再次安装,但它不起作用。
大家有什么想法吗?谢谢。