【问题标题】:support:CardView minimum SDK?支持:CardView 最低SDK?
【发布时间】:2014-08-30 21:22:35
【问题描述】:

我正在尝试通过添加以下行将 CardView 支持添加到我的应用程序中,以支持低于 Android L 的设备:

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.+'
}

【问题讨论】:

    标签: android gradle android-cardview


    【解决方案1】:

    虽然 CardView 和 RecyclerView 都是 new widgets being added to the support library(因此将在 API 7+ 设备上可用),但在开发者预览期间,它们仅限于 Android L 设备。

    【讨论】:

    • 谢谢。这有点麻烦,我的应用支持 Wear,我无法运行模拟器,因为 Google Play 服务无法在模拟器上运行
    • 是的,如果您现在需要 Android L 和 Google Play 服务,您将需要购买 Nexus 5 或 Nexus 7。
    • 我有一个 Nexus 5,但它是我的日常驱动程序。我已经在它上面尝试过 Android L,但它在我需要手机的时间里不够稳定 :(
    • 如果这回答了您的问题,请接受答案以将其从未回答的问题列表中删除。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-16
    • 2022-07-19
    • 2011-01-01
    • 2019-09-18
    相关资源
    最近更新 更多