简体   繁体   English

Android Studio中发生[INSTALL_FAILED_OLDER_SDK]故障

[英]Failure [INSTALL_FAILED_OLDER_SDK] in Android Studio

So I know that many other people had this problem, but mine is a little different. 因此,我知道其他许多人都遇到了这个问题,但是我的却有所不同。 I've tried running my app on an LG G2 with Android 4.4.4, and a Note 3 with Android 4.4.2, but neither worked. 我曾尝试在装有Android 4.4.4的LG G2和装有Android 4.4.2的Note 3上运行我的应用程序,但均无用。 I have installed the API 18, 19, and 20 SDKs. 我已经安装了API 18、19和20 SDK。

Failure [INSTALL_FAILED_OLDER_SDK] 失败[INSTALL_FAILED_OLDER_SDK]

build.gradle: 的build.gradle:

 apply plugin: 'com.android.application'

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

    defaultConfig {
        applicationId "com.ween.control"
        minSdkVersion 8
        targetSdkVersion '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'])
    compile 'com.android.support:appcompat-v7:19.+'
}

You can't test an Android-L app on a device with lower API. 您无法在API较低的设备上测试Android-L应用。 Take a look here . 在这里看看。

You need to make sure your dependencies are configured targeting the same sdk (also make sure the sdk is supported for the dependency). 您需要确保将依赖项配置为针对相同的sdk(也要确保依赖项支持sdk)。

As of version .11, the gradle plugin now uses the new manifest merger tool by default which you can use to avoid conflicting configurations when merging manifests from your dependencies while building by specifying <uses-sdk tools:node="replace" /> in your AndroidManifest.xml file. 从.11版本开始,gradle插件现在默认情况下使用新的清单合并工具,您可以在指定时<uses-sdk tools:node="replace" />在构建时从依赖项合并清单时避免配置冲突。您的AndroidManifest.xml文件。

http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger

credit goes to Eddie Ringle 归功于Eddie Ringle

我遇到了类似的问题,但我的设备sdk为19,并且它的期望值是20。我将sdk从文件> Project Structure> SDK更改为19,在运行时我也注意到它在其中选择了损耗值顶部的工具栏,所以我将其切换为移动和Voila。

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

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