1

Debugging my app with Android Studio 0.8.6, I get the error: "Failure [INSTALL_FAILED_OLDER_SDK]"

My build.gradle looks like this:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'android-L'
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.bla.towerofhanoi"
        minSdkVersion 14
        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 project(':third_party:andengine')
}
user5262
  • 391
  • 5
  • 11
  • 1
    You can find your answer here http://stackoverflow.com/questions/24465289/android-studio-failure-install-failed-older-sdk This question is a possible duplicate – Psypher Sep 02 '14 at 13:03
  • Thank you. Now I am getting another error: http://stackoverflow.com/questions/25624256/android-studio-0-8-6-error-installing-android-sdk-platform-20 – user5262 Sep 02 '14 at 13:11
  • This is the same link you posted above ... – user5262 Sep 02 '14 at 13:22
  • I am getting the error "failed to find target android-20 : C:\android-studio\sdk" Install missing platform(s) and sync project – user5262 Sep 02 '14 at 13:23

2 Answers2

0

Add <uses-sdk tools:node="replace" /> in your manifest file and sync project.

Psypher
  • 10,717
  • 12
  • 59
  • 83
0

Check the doc at http://developer.android.com/preview/setup-sdk.html.

You have to use

  minSdkVersion 'L'

and you have to run the app in device with Android-L or an emulator with Android-L. The build system when compileSdkVersion is 'android-L' or targetSdkVersion is 'L' forces the minSdk to 'L' to prevent apps published with the API in preview.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841