2015-04-17 24 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

相关问题