Failure [INSTALL_FAILED_OLDER_SDK]

Asked

Viewed 479 times

1

I want to print a "Hello World" on the screen, created a new project with any name in Android Studio, clicked on "Run" and it returned me this error...

I checked Androidmanifest and everything looks OK (add sdkMin and sdkTarget and it didn’t work either):

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.saapc.meumapa" >

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".IndexAcitivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

In build.graddle I also tried to change the SDK min and target settings, also without success...

apply plugin: 'com.android.application'

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

    defaultConfig {
        applicationId "com.example.saapc.meumapa"
        minSdkVersion 15
        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'])
}

I tried to install several Sdks and packages in SDK Manager, nothing solved. On all the websites I saw questions about this error said to change Minskdversion and Targetsdkversion. How to solve this?

1 answer

1

Unfortunately when using the L version as targetSdkVersion, he forces the minSdkVersion whether L also, whether declared independent minSdkVersion like 15.

In this case you could use SDK 20 or 19 as the targetSdkVersion or follow one of the two alternatives to use SDK L Preview:

To deploy the L version, you need to install your apk in an AVD with the L Preview image, which is available in the SDK Manager.

Or install an Android L image, made available by Google, on a Nexus device (5 or 7 2013).

For more details of a look at https://developer.android.com/preview/setup-sdk.html.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.