Android Studio : Failure [INSTALL_FAILED_OLDER_SDK]

后端 未结 24 1332
孤街浪徒
孤街浪徒 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:18

    Failure [INSTALL_FAILED_OLDER_SDK]

    basically means that the installation has failed due to the target location (AVD/Device) having an older SDK version than the targetSdkVersion specified in your app.

    FROM

    apply plugin: 'com.android.application'
    
    android {
    
    compileSdkVersion 'L' //Avoid String change to 20 without quotes
    buildToolsVersion "20.0.0"
    
    defaultConfig {
        applicationId "com.vahe_muradyan.notes"
        minSdkVersion 8
        targetSdkVersion 'L' //Set your correct Target which is 17 for Android 4.2.2
        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.+' // Avoid Generalization 
    // can lead to dependencies issues remove +
    
    }
    

    TO

    apply plugin: 'com.android.application'
    
    android {
    compileSdkVersion 20 
    buildToolsVersion "20.0.0"
    
    defaultConfig {
        applicationId "com.vahe_muradyan.notes"
        minSdkVersion 8
        targetSdkVersion 17
        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.0.0'
    }
    

    This is common error from eclipse to now Android Studio 0.8-.8.6

    Things to avoid in Android Studio (As for now)

    • Avoid Strings instead set API level/Number
    • Avoid generalizing dependencies + be specific

提交回复
热议问题