2015-04-17 23 views
3

我正在嘗試將Urban Airship Library添加到我的項目中。我遵循的步驟完全相同,但是當我建立我得到這個錯誤Android:Urban Airship 6.0.1:android:elevation找不到與指定名稱相匹配的資源

No resource found that matches the given name: attr'android:elevation' 


    <?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <!-- From: file:/Users/build/workspace/android-library/UrbanAirship/src/main/res/values-v21/styles.xml --> 
    <eat-comment/> 
    <style name="Widget.UrbanAirship.InAppMessage.Banner" parent="Base.Widget.UrbanAirship.InAppMessage.Banner"> 
     <item name="android:background">@drawable/ua_iam_background</item> 
     <item name="android:elevation">@dimen/ua_iam_banner_elevation</item> 
    </style> 
</resources> 

這是我gradle這個文件相關

compile 'com.android.support:support-v4:22.0.0' 
compile 'com.android.support:cardview-v7:22.0.0' 
compile 'com.google.android.gms:play-services-gcm:7.0.0' 
compile 'com.google.android.gms:play-services-location:7.0.0' 

我targetSdkVersion是21歲,我還從SDK管理器更新了我的API

http://docs.urbanairship.com/platform/android.html參考

請幫助我。謝謝!

更新1:在gradle這個

android { 
    compileSdkVersion 19 
    buildToolsVersion "21.1.1" 

    defaultConfig { 
     applicationId "com.example" 
     minSdkVersion 14 
     targetSdkVersion 21 
     multiDexEnabled true 
     renderscriptTargetApi 22 
     renderscriptSupportModeEnabled true 
    } 

    dexOptions { 
     javaMaxHeapSize "4g" 
    } 

    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/dependencies.txt' 
     exclude 'META-INF/LGPL2.1' 
    } 
} 
+0

你可以發佈您的build.gradle文件的Android的部分Android部分? – ralepinski

+0

@ralepinski我發佈了Android版塊 –

回答

7

嘗試compileSdkVersion設置爲21

+0

謝謝,已修復:) –

+0

太棒了!您現在可能想要使用22,現在5.1已經不存在,並且您正在使用v22版本的支持庫。 – ralepinski

相關問題