首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Android Studio :失败[INSTALL_FAILED_OLDER_SDK]

Android Studio :失败[INSTALL_FAILED_OLDER_SDK]
EN

Stack Overflow用户
提问于 2014-06-28 17:04:19
回答 18查看 133.1K关注 0票数 55

今天我下载了Android Studio 0.8.0测试版。我正在尝试在SDK 17上测试我的应用程序。Android studio error Failure [INSTALL_FAILED_OLDER_SDK]这里是我的android清单

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.vahe_muradyan.notes" >
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".Main_Activity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

看起来android studio使用的是build.gradle.Here is build.gradle中的配置

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 'L'
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.vahe_muradyan.notes"
        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.+'
}
EN

回答 18

Stack Overflow用户

发布于 2014-06-30 18:08:44

这里有我的配置来支持安卓的L和旧版本:

apply plugin: 'com.android.application'

android {
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.uladzimir_klyshevich.myapplication"
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }


    productFlavors {
        l {
            minSdkVersion 'android-L'
            targetSdkVersion 'android-L'
            compileSdkVersion 'android-L'
        }
        old {
            minSdkVersion 10
            targetSdkVersion 20
            //TODO comment second line if build is not compiles for "L"
            compileSdkVersion 20
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    lCompile 'com.android.support:appcompat-v7:21.+'
    oldCompile 'com.android.support:appcompat-v7:19.1.0'
}

因此,您将拥有各种口味:

oldDebug
oldRelease
lDebug
lRelease

并且可以在旧版本的android上安装你的应用程序。

票数 27
EN

Stack Overflow用户

发布于 2014-07-04 22:16:19

我使用的是Android Studio Beta版本0.8.1,我也有同样的问题。我现在通过改变AVD (我使用Genymotion)到API19来解决我的问题。这是我的build.gradle文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.example.daroath.actionbar"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

希望这对你有所帮助!

票数 6
EN

Stack Overflow用户

发布于 2014-07-16 13:14:26

正如前面提到的,切换到build 19是这里建议的路线,直到v20被“修复”。这个帖子帮助我解决了这个问题,但似乎这里也有类似的答案。https://code.google.com/p/android/issues/detail?id=72840

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24465289

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档