2014-08-30 80 views
1

我試圖通過添加行添加CardView支持到我的應用程序的設備比Android L以下:支持:CardView最低SDK?

compile 'com.android.support:cardview-v7:21.+' 

然後我添加compileSdkVersion和targetSdkVersion爲「Android的L」

現在,除非我錯了,我認爲這會在4.4.4建立在我的Nexus 5,但我得到的錯誤

失敗[INSTALL_FAILED_OLDER_SDK]

我錯過了什麼或誤解了這一點?充分的build.gradle下面:

應用插件: 'com.android.application'

android { 
    compileSdkVersion 'android-L' 
    buildToolsVersion "20.0.0" 

    defaultConfig { 
     applicationId "com.gh.app" 
     minSdkVersion 15 
     targetSdkVersion 'android-L' 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      runProguard false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    wearApp project(':wear') 
    compile 'com.google.android.gms:play-services-wearable:+' 
    compile 'com.android.support:support-v4:20.0+' 
    compile files('libs/TalkClient.jar') 
    compile 'com.android.support:cardview-v7:21.+' 
} 

回答

3

雖然CardView和RecyclerView均爲new widgets being added to the support library(並因此將可在API 7+裝置),顯影劑在預覽它們僅限於Android L設備。

+0

謝謝。這是一個討厭的人,我的應用程序是Wear的支持,我不能讓模擬器運行,因爲Google Play服務無法在模擬器上工作 – K20GH 2014-08-30 21:31:39

+0

是的,如果你現在想要Android L和Google Play服務,你將要投資Nexus 5或Nexus 7. – ianhanniballake 2014-08-30 21:33:26

+0

我有Nexus 5,但它是我的日常驅動程序。我已經嘗試過Android L,但它不夠穩定的時間,我需要我的手機:( – K20GH 2014-08-30 21:34:10