我一直在试图用一些内置视图运行一个简单的应用程序,但在Android Studio启动时,Gradle同步完成时几乎没有错误。我试过了在互联网上看到的多种方法,但没有任何效果。我还从Android Studio文件中替换了gradle-2.14.1文件夹,通过下载zip文件并解压缩,但这不起作用。Android Studio Gradle同步失败
下面是的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:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
代码的build.gradle(APP):
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.heenamehta.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs' , include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
testCompile 'junit:junit:4.12'
}
摇篮的包装器的属性:
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
我还附加了在消息部分显示错误的图像。 Here is the image 还为额外的信息,我使用: 的Android 2.2.3工作室与 SDK API级别23和 构建工具25.0.2
请阅读(HTTPS [在什么情况下我想补充“紧急”或其他类似的短语我的问题,为了获得更快的答案?]:/ /meta.stackoverflow.com/q/326569) - 总结是,这不是处理志愿者的理想方式,而且可能适得其反。爱宁的答案。请不要将这添加到您的问题。 – halfer