Android Studio 不会停止请求 appcompat-v23
Android Studio won't stop asking for appcompat-v23
我不想用v23,我想用v22。我到处都指定了 v22,但是当我尝试同步 gradle 文件时,我得到:
Error:Failed to resolve: com.android.support:appcompat-v7:23.0.0
Install Repository and sync project
Open File
Show in Project Structure dialog
所以我点击“打开文件”,它会打开应用 build.gradle:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
<snip>
}
}
compileSdkVersion 'Google Inc.:Google APIs:22'
buildToolsVersion '22.0.1'
defaultConfig {
applicationId 'com.global.android.cwa'
minSdkVersion 9
targetSdkVersion 20
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix ".debug"
}
}
productFlavors {
Pro {
applicationId "com.global.android.pwa"
signingConfig signingConfigs.config
targetSdkVersion 22
}
Simple {
applicationId "com.global.android.swa"
signingConfig signingConfigs.config
targetSdkVersion 22
}
Beta {
applicationId "com.global.android.pwab"
signingConfig signingConfigs.config
targetSdkVersion 22
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
}
如果我选择安装存储库和同步项目,那么我在编译过程中会遇到如下错误:
android-apt-compiler: [appcompat] D:\Android SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
而且我可以在外部库中看到它包含 appcompat-v23。
有人可以帮我摆脱 gradle 一直试图在我的项目中包含 appcompat v23 的恶魔吗?
您正在使用
compile 'com.google.android.gms:play-services:9.0.0'
这个版本has a dependency with support libraries v23.
您必须使用 API23 进行编译。
compileSdkVersion 23
我不想用v23,我想用v22。我到处都指定了 v22,但是当我尝试同步 gradle 文件时,我得到:
Error:Failed to resolve: com.android.support:appcompat-v7:23.0.0
Install Repository and sync project
Open File
Show in Project Structure dialog
所以我点击“打开文件”,它会打开应用 build.gradle:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
<snip>
}
}
compileSdkVersion 'Google Inc.:Google APIs:22'
buildToolsVersion '22.0.1'
defaultConfig {
applicationId 'com.global.android.cwa'
minSdkVersion 9
targetSdkVersion 20
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix ".debug"
}
}
productFlavors {
Pro {
applicationId "com.global.android.pwa"
signingConfig signingConfigs.config
targetSdkVersion 22
}
Simple {
applicationId "com.global.android.swa"
signingConfig signingConfigs.config
targetSdkVersion 22
}
Beta {
applicationId "com.global.android.pwab"
signingConfig signingConfigs.config
targetSdkVersion 22
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
}
如果我选择安装存储库和同步项目,那么我在编译过程中会遇到如下错误:
android-apt-compiler: [appcompat] D:\Android SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
而且我可以在外部库中看到它包含 appcompat-v23。
有人可以帮我摆脱 gradle 一直试图在我的项目中包含 appcompat v23 的恶魔吗?
您正在使用
compile 'com.google.android.gms:play-services:9.0.0'
这个版本has a dependency with support libraries v23.
您必须使用 API23 进行编译。
compileSdkVersion 23