简体   繁体   English

支持:CardView最低SDK?

[英]support:CardView minimum SDK?

I'm trying to add CardView support into my app for devices lower than Android L by adding the line: 我试图通过添加以下行,将CardView支持添加到我的应用中,以支持Android L以下的设备:

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

I've then added compileSdkVersion and targetSdkVersion to 'android-L' 然后,我已将compileSdkVersion和targetSdkVersion添加到“ android-L”

Now, unless I am mistaken, I thought that this would have built on my Nexus 5 in 4.4.4, however I get the error 现在,除非我弄错了,我以为这应该是在4.4.4的Nexus 5上构建的,但是我得到了错误

Failure [INSTALL_FAILED_OLDER_SDK] 失败[INSTALL_FAILED_OLDER_SDK]

Am I missing something or misunderstood this? 我错过了什么还是误解了吗? Full build.gradle below: 完整的build.gradle如下:

apply plugin: 'com.android.application' 应用插件:“ 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.+'
}

虽然CardView和RecyclerView都是添加到支持库的新窗口小部件 (因此将在API 7+设备上可用),但在开发人员预览期间,它们仅限于Android L设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM