【发布时间】:2015-01-31 17:55:29
【问题描述】:
我的应用突然停止编译并显示一堆错误,例如“找不到与给定名称匹配的资源:attr android:actionModeShareDrawable”。
我没有使用 appcompat 21.0.0 或 android 5 sdk,因为 StackOverflow 上的许多答案都建议,并且上周五编译了相同的代码。
唯一不同的是,我现在使用的是 Android Studio RC2。
这是我的 build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/repo' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/repo' }
}
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
//noinspection GroovyAssignabilityCheck
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
versionCode 15
versionName "1.8"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
debug {
debuggable true
applicationIdSuffix ".debug"
}
}
}
dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile 'com.android.support:appcompat-v7:20.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.sothree.slidinguppanel:library:+'
provided 'com.google.android.gms:play-services:5.0.89'
compile project(':libraries:ViewPagerIndicator')
compile files('libs/mobileservices-1.1.5.jar')
compile files('libs/volley.jar')
compile files('libs/picasso-2.3.5-SNAPSHOT.jar')
compile 'com.microsoft.azure.android:azure-storage-android:0.3.1'
compile 'com.squareup.okhttp:okhttp:2.1.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.1.0@aar') {
transitive = true;
}
}
这里是 gradle.properties:
ANDROID_BUILD_MIN_SDK_VERSION=15
ANDROID_BUILD_TARGET_SDK_VERSION=19
ANDROID_BUILD_TOOLS_VERSION=20
ANDROID_BUILD_SDK_VERSION=19
我没有引用 Android 5 SDK 或兼容性库 v21,那么为什么我会为这个资源密钥而烦恼呢?
【问题讨论】:
-
我有同样的问题,当我删除一个模块时发生了。
-
在没有 android: 的情况下尝试 actionModeShareDrawable 并告诉结果
-
我没有在我的代码中设置这个。
标签: android