繁体   English   中英

错误:失败[INSTALL_FAILED_OLDER_SDK]

[英]Error: Failure [INSTALL_FAILED_OLDER_SDK]

我正在使用Android Studio 0.82,并且遇到错误:失败[INSTALL_FAILED_OLDER_SDK]。

我在AndroidManifest.xml中写了以下几行

*<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />*

这是我的build.gradle apply插件:'com.android.application'

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

    defaultConfig {
        applicationId "Comss.sskapp"
        minSdkVersion 15
        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'])
}

在尝试解决您的答案之后:我的新build.gradle现在看起来像这样:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId"ComImOK.imokapp"
        minSdkVersion 20
        targetSdkVersion 20
        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.google.android.support:wearable:+'
    compile 'com.google.android.gms:play-services-wearable:+'
}

和我的AndroidManifest.xml:

*<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />*

另外我的风格是:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!--<style name="AppTheme" parent="android:Theme.Material.Light">-->
    <style name="AppTheme" parent="android:Theme.Holo.Light">
    </style>
</resources>

还是一样的错误

改变你的

compileSdkVersion 'android-L'

compileSdkVersion 19

(或您希望的17或20)

即使minSdk小于L ,而compileSdkVersion为L,也会出现错误。

一样

targetSdkVersion 'L'

正如@HocineHamdi在这里提到的那样您需要在build.gradle模块中的build.gradle文件中进行一些更改。 编辑将是

apply plugin: 'com.android.application'

android {
compileSdkVersion 20
buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "your package name"
    minSdkVersion 20
    targetSdkVersion 20
    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.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
}

暂无
暂无

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

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