2014-12-03 51 views
1

我的應用程序突然停止了編譯,並呈現出一堆錯誤,如「沒有資源的發現,給定的名稱匹配:ATTR機器人: actionModeShareDrawable」。沒有資源發現在給定名稱匹配:ATTR安卓actionModeShareDrawable即使我使用程序兼容性20

我不使用程序兼容性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:[email protected]') { 
     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,那麼爲什麼打擾我關於這個資源鍵?

+0

我有同樣的問題,它與我們happend當我刪除的模塊。 – 2014-12-03 10:02:48

+0

嘗試actionModeShareDrawable沒有Android:告訴結果 – hasan83 2014-12-03 10:16:35

+0

我不會在我的代碼設置此。 – 2014-12-03 10:42:44

回答

0

我不知道是什麼原因造成的,但我有同樣的問題,這種解決方法爲我工作:

添加

configurations.all { 
    resolutionStrategy { 
     force 'com.android.support:appcompat-v7:20.0.0' 
    } 
} 

了Android {}塊下方的gradle的文件。

編輯:此錯誤是由AndroidSlidingUpPanel庫造成的。 解決方法是包括像這樣的項目庫:

compile('com.sothree.slidinguppanel:library:+') { 
    exclude group: 'com.android.support', module: 'appcompat-v7' 
} 
+0

如何查看我的應用程序依賴關係的依賴關係?我不認爲我已更新我的依賴版本,但由於我沒有直接引用Android 21中的任何內容,因此找到罪魁禍首的唯一方法是查看我正在使用的庫。 – 2014-12-03 11:33:54

+0

我也沒有從Android 21中引用任何東西。我只是將其包含在我的應用程序模塊的build.gradle中。 – 2014-12-03 11:36:06

+1

我發現誰是導致錯誤的依賴,這是SlidingUpPanel從https://github.com/umano/AndroidSlidingUpPanel – 2014-12-04 08:50:58

相關問題