Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

INSTALL_FAILED_OLDER_SDK when SDK versions look like it should work?

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.

like image 765
Corey Ogburn Avatar asked Jul 01 '13 14:07

Corey Ogburn


People also ask

How do I check sdk version?

This can be found under the menu TOOLS -> Android -> Android SDK Manager.

How do I choose Android SDK version?

Click Tools > SDK Manager. In the SDK Platforms tab, select Android 11. In the SDK Tools tab, select Android SDK Build-Tools 30 (or higher). Click OK to begin install.

What is install failed older sdk?

This error Failure [INSTALL_FAILED_OLDER_SDK] Means that you're trying to install an app that has a higher minSdkVersion specified in its manifest than the device's API level. Change that number to 8 and it should work.

What is a sdk version?

The target sdk version is the version of Android that your app was created to run on. The compile sdk version is the the version of Android that the build tools uses to compile and build the application in order to release, run, or debug. Usually the compile sdk version and the target sdk version are the same.


1 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.

like image 153
Corey Ogburn Avatar answered Nov 15 '22 20:11

Corey Ogburn