Home » Android » android – INSTALL_FAILED_OLDER_SDK when SDK versions look like it should work?

android – INSTALL_FAILED_OLDER_SDK when SDK versions look like it should work?

Posted by: admin June 15, 2020 Leave a comment

Questions:

I have an old P500 running the latest CM 7.2 Nightly which is of Gingerbread, specifically 2.3.7 which should be API 10, right? I’m working on an app with the following line in the manifest:

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17" />

It’s a really basic app where the only permission is android.permission.RECORD_AUDIO and all in all it couldn’t be much simpler. I do have the SDK Platform installed for 2.3.3 API 10.

Even if I set min and target both to 10 or even lower, then I still get INSTALL_FAILED_OLDER_SDK when I build and run. No matter what I try, I can’t get it to install.

I’m using the latest Android Studio (0.1.8 I think) and Java 1.7u21. The app does install just fine on my CM 10.1 Galaxy S III which is 4.2.2.

How to&Answers:

I figured out what was causing it. Android Studio doesn’t seem to be using AndroidManifest.xml to determine how to build the APK. In the project directory, there exists a file build.gradle that tells what API to build for and it contradicted the AndroidManifest!

Here’s the section of the file:

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 17
    }
}

As soon as I changed minSdkVersion to 10 it installed just fine. It was the only change I had to make.