我想在我的一個項目中使用Material Design。但是我對appcompat-v7:21.0.0庫有着非常不好的體驗。只要我在Android Studio中添加依賴項並開始同步,就會出現以下錯誤。找不到與給定名稱相匹配的資源:attr'android:actionModeShareDrawable'appcompat -v7:21.0.0 with compileSdkVersion 21
Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
No resource found that matches the given name: attr 'android:overlapAnchor'.
但我確定我正在用最新的編譯工具編譯最新的SDK 21。這是我的構建配置。
android {
compileSdkVersion 21
buildToolsVersion '21.0.1'
defaultConfig {
minSdkVersion 15
targetSdkVersion 21
versionCode 3
versionName "0.0.003"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
我在這裏做的錯誤是什麼?它是否適用於其他人? 這是我的其他依賴FYI。有人經歷了這一步,請指導我。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/smartconfiglib.jar')
compile 'com.android.support:support-v4:21.0.0'
compile 'com.crashlytics.android:crashlytics:1.1.13'
compile 'com.google.android.gms:play-services:6.1.11'
compile 'com.jakewharton.hugo:hugo-runtime:1.1.0'
compile 'com.squareup.retrofit:retrofit:1.7.1'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.jakewharton:butterknife:5.1.2'
compile 'de.greenrobot:eventbus:2.2.1'
compile 'fr.avianey:facebook-android-api:[email protected]'
compile('de.keyboardsurfer.android.widget:crouton:[email protected]') {
exclude group: 'com.google.android', module: 'support-v4'
}
apt 'com.turbomanage.storm:storm-impl:0.99'
compile 'com.turbomanage.storm:storm-api:0.99'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.apptentive:apptentive-android:[email protected]'
compile 'com.github.flavienlaurent.datetimepicker:library:0.0.2'
}
你見過http://stackoverflow.com/questions/26457096/appcompat-v7-r21-returning-error-in-values-xml嗎? – 2014-10-28 13:00:17
[appcompat-v7:21.0.0'可能的重複:找不到與給定名稱相匹配的資源:attr'android:actionModeShareDrawable'](http://stackoverflow.com/questions/26431676/appcompat-v721-0-0 -no-resource-found-that-matches-the-name-attr-andro) – reVerse 2014-10-28 14:37:09
@shayanpourvatan該解決方案不起作用。我的問題是我已經在使用最新的構建工具(21.0.1),SDK平臺(21)。它仍然不起作用。 – Gopinath 2014-10-29 06:41:55