gpt4 book ai didi

android - 失败 [INSTALL_FAILED_OLDER_SDK] Android-L

转载 作者:IT王子 更新时间:2023-10-29 00:03:58 26 4
gpt4 key购买 nike

我正在尝试使用来自 Android L 的新 CardView。我更新了 SDK 管理器中的所有内容,但我不断收到以下错误:

Failure [INSTALL_FAILED_OLDER_SDK]

这是我的 build.gradle 文件:

apply plugin: 'android'

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

defaultConfig {
applicationId "www.thomascbeerten.com.nieuwetests"
minSdkVersion 8
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
// Support Libraries
compile 'com.android.support:support-v4:19.1.0'
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.android.support:gridlayout-v7:19.1.0'
compile 'com.android.support:mediarouter-v7:19.1.0'
// compile 'com.android.support:support-v13:19.1.0'
compile 'com.android.support:recyclerview-v7:+'
}

最佳答案

Recently there was a post here regarding the L SDK's incompatibility with prior versions of Android. I've been digging in AOSP repositories for quite a few hours now, and determined that the tools behave this way because they are designed to treat preview platforms differently. If you compile against a preview SDK (android-L), the build tools will lock minSdkVersion and targetSdkVersion to that same API level. This results in the produced application being unable to be installed on devices running older releases of Android, even if your application isn't doing anything specific to L. To make matters worse, the new support libs (CardView, RecyclerView, Palette, etc.) are also locked into the L API level, even though--according to their repository names--they should work on API level 7 just fine (and they do!).

请参阅我的 Reddit 帖子 here , 有一个解决方法。

关于android - 失败 [INSTALL_FAILED_OLDER_SDK] Android-L,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24457831/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com