Android Studio : Failure [INSTALL_FAILED_OLDER_SDK]

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

提交回复
热议问题