android – Installation error: INSTALL_FAILED_OLDER_SDK

android – Installation error: INSTALL_FAILED_OLDER_SDK

It is due to android:[email protected]/app_name in your manifiest file.
Change it to:

<uses-sdk android_minSdkVersion=15 android_targetSdkVersion=15/>

The targetSdkVersion should be an integer, but @string/app_name would be a string. I think this causing the error.

EDIT:
You have to add a default intent-filter in your manifiest file for the activity. Then only android can launch the activity. otherwise you will get the below error in your console window.

[2012-02-02 09:17:39 - Test] No Launcher activity found!
[2012-02-02 09:17:39 - Test] The launch will only sync the application package on the device!

Add the following to your <activity> tag.

<activity android_name=HelloAndroid android_launchMode=standard android_enabled=true>  
  <intent-filter>
    <action android_name=android.intent.action.MAIN />
    <category android_name=android.intent.category.LAUNCHER />
  </intent-filter>
</activity>

This means the version of android of your avd is older than the version being used to compile the code

android – Installation error: INSTALL_FAILED_OLDER_SDK

This error occurs when the sdk-version installed on your device (real or virtual device) is smaller than android:minSdkVersion in your android manifest.

You either have to decrease your android:minSdkVersion or you have to specify a higher api-version for your AVD.

Keep in mind, that it is not always trivial to decrease android:minSdkVersion as you have to make sure, your app cares about the actual installed API and uses the correct methods:

AsyncTask<String, Object, String> task = new AsyncTask<String, Object, String>() {
    @Override
    protected Boolean doInBackground(String... params) {
        if (params == null) return ;
        StringBuilder b = new StringBuilder();
        for (String p : params) {
             b.append(p);
        }
        return b.toString();
    }
};
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,Hello,  , world!);
} else {
    task.execute(Hello,  , world!);
}

Using the android-support-library and/or libraries like actionbar-sherlock will help you dealing especially with widgets of older versions.

Leave a Reply

Your email address will not be published.