Android Studio : Failure [INSTALL_FAILED_OLDER_SDK]

后端 未结 24 1227
孤街浪徒
孤街浪徒 2020-11-27 04:54

Today I have downloaded Android Studio v 0.8.0 beta. I am trying to test my app on SDK 17 . Android studio error Failure [INSTALL_FAILED_OLDER_SDK] Here is my a

相关标签:
24条回答
  • 2020-11-27 05:35

    Just installed Android Studio v 0.8.1 beta and ran into the same problem targeting SDK 19.

    Copied 19 from the adt-bundle to android-studio, changed build.gradle to:

    compileSdkVersion 19 targetSdkVersion 19

    then project -> app -> open module settings (aka project structure): change compile sdk version to 19.

    Now works fine.

    0 讨论(0)
  • 2020-11-27 05:36

    Check the 'minSdkVersion' in your build.gradle

    The default project creates it with the latest API, so if you're phone is not yet up-dated (e.g. minSdkVersion 21), which is probably your case.

    Make sure the minSdkVersion value matches with the device API version or if the device has a higher one.

    Example:

    defaultConfig {
        applicationId 'xxxxxx'
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    
    0 讨论(0)
  • 2020-11-27 05:37

    I'm using Android Studio Beta version 0.8.1 and I have the same problem. I now I sold my problem by changing the AVD (I'm using Genymotion) to API 19. and here is my build.gradle file

    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'])
    }
    

    enter image description here

    Hope this help!

    0 讨论(0)
  • 2020-11-27 05:39

    There are my config to support L and old versions of android:

    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'
    }
    

    As result you will have flavors:

    oldDebug
    oldRelease
    lDebug
    lRelease
    

    And can install your application on old versions of android.

    0 讨论(0)
  • 2020-11-27 05:41

    Check the minimum API level inside the build.gradle(module: app)[inside of the gradle scripts]. Thatt should be equal to or lower than the device you use

    0 讨论(0)
  • 2020-11-27 05:42

    In build.gradle change minSdkVersion 17 or later.

    0 讨论(0)
提交回复
热议问题