错误:失败[INSTALL_FAILED_OLDER_SDK]

时间:2014-08-01 16:14:38

标签: android

我使用的是Android Studio 0.82 我遇到了错误:失败[INSTALL_FAILED_OLDER_SDK]。

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

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

这是我的build.gradle apply plugin:'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>

仍然是同样的错误

2 个答案:

答案 0 :(得分:0)

更改您的

compileSdkVersion 'android-L'

compileSdkVersion 19

(或17或20,如你所愿)

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

相同
targetSdkVersion 'L'

答案 1 :(得分:0)

由于@HocineHamdi提到here,您需要在wear模块的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:+'
}