android:将Android Studio升级到2.3后无法构建项目 [英] android : cannot build project after upgrading Android Studio to 2.3
问题描述
因此,很高兴将我的Android Studio从稳定版2.2更新为金丝雀频道2.3.
So, happily updated my Android Studio from stable version 2.2 to canary channel 2.3.
但是,不幸的是,它具有严重的错误.项目无法建立.我尝试打开以前的项目,也尝试创建新的示例应用程序,但出现以下错误:
But, unfortunately, it has serious bug. Project is not able to build. I tried opening my previous projects and also tried creating new sample application, I got same below error:
Gradle 'MyApplication' project refresh failed
Error:A problem occurred configuring project ':app'.
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.3.0-alpha1'
// 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 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.chint.myapplication"
minSdkVersion 16
targetSdkVersion 25
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:25.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support:design:25.0.0'
testCompile 'junit:junit:4.12'
}
我是唯一遇到此问题的人吗?
Am I the only one with this issue ?
推荐答案
因此,在显示此对话框时要小心:
So, be careful while this dialog appears:
选择稍后提醒我",不更新"
Choose "Remind me later" and NOT "Update"
保留现有的构建版本.
如果您按了Update,那么只需将 build.gradle(project)
中的Android Gradle插件类路径回滚到以下位置:
Incase, you pressed Update, so just rollback your Android Gradle Plugin classpath in build.gradle(project)
to below one:
classpath 'com.android.tools.build:gradle:2.2.2'
这对我有用.
这篇关于android:将Android Studio升级到2.3后无法构建项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!