What does "Failure [INSTALL_FAILED_OLDER_SDK]" mean in Android Studio? - android

I got this Froyo (2.2) device that I am using to make an app.
When I try to run the app directly to the device it shows an error saying
pkg: /data/local/tmp/com.example.HelloWorldProject
Failure [INSTALL_FAILED_OLDER_SDK]
and in another window there's an error saying
Unable to attach test reporter to test framework or test framework quit unexpectedly
What seem to make the said errors?
EDIT:
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.helloworld"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17"/>
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
>
<activity
android:name="com.example.HelloWorldProject.MyActivity"
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>

After I changed
defaultConfig {
applicationId "com.example.bocheng.myapplication"
minSdkVersion 15
targetSdkVersion 'L' #change this to 19
versionCode 1
versionName "1.0"
}
in build.gradle file.
it works

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. I'm not sure about the other error, but it may be related to this one.

Besides checking the right minSdkVersion in build.gradle, make sure you have installed all necessary tools and correct SDK Platform for your preferred Android Version in SDK Manager. In Android Studio klick on Tools -> Android -> SDK Manager. Then install at minimum (for Android 2.2 without emulator):
Android SDK Tools
Android SDK Platform-tools
Android SDK Build-tools (latest)
Android 2.2 (API 8)
SDK Platform
Google APIs
This is what worked for me.

Make sure you don't have a minSdkVersion set in your build.gradle with a value higher than 8. If you don't specify it at all, it's supposed to use the value in your AndroidManfiest.xml, which seems to already be properly set.

Just removing uses-sdk tag works for me for such problems.

Failure [INSTALL_FAILED_OLDER_SDK] basically means that the installation has failed due to the target location (AVD/Device) having an older SDK version than the targetSdkVersion specified in your app.
N/B Froyo 2.2 API 8
To fix this simply change
targetSdkVersion="17" to targetSdkVersion="8"
cheers.

Make Sure the Select Run/Debug Configuration is wear or mobile as per your installation in android studio...

Failure [INSTALL_FAILED_OLDER_SDK]
For Sumsung note3 I just edit the AndroidManifest.xml file and add the following code:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17"/>

In your manifest file package attribute is set to com.test.helloworld however your activity class is under different package. Change your MyActivity class package to com.example.helloworld

This is because you mobile has older sdk version than your application..!!!
It means your application need sdk version suppose Lollipop but you mobile has version kitkat.

Fix your gradle file the following way
defaultConfig {
applicationId "package.com.app"
minSdkVersion 8 //this should be lower than your device
targetSdkVersion 21
versionCode 1
versionName "1.0"
}

In android studio: reduce minSDKversion. It will work...
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "healthcare.acceliant.trianz.com.myapplication"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
}

I fixed this problem.The device system version is older then the sdk minSdkVersion。
I just modified the minSdkVersion from android_L to 19
to target my nexus 4.4.4.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
apply plugin: 'com.android.application'
repositories {
jcenter()
}
android {
**compileSdkVersion 'android-L'** modified to 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.antwei.uiframework.ui"
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 'com.android.support:support-v4:21.+'** modified to compile 'com.android.support:support-v4:20.0.0'
}
how to modified the value by ide.
select file->Project Structure -> Facets -> android-gradle and then modified the compile Sdk Version from android_L to 19
sorry I don't have enough reputation to add pictures

Maybe go to File>Project Structure > Modules and Change your Source Compability to a lower version before Ive done this, Ive changed in build.gradle
mindSdk and tragetSdk from 31 to 30.
Now I can use the Emulator without problems

Change file AndroidManifest.xml
<uses-sdk android:minSdkVersion="19"/>
<uses-sdk android:minSdkVersion="14"/>

Related

Android Studio - Appcompat build fail values-v23/styles_bases.xml

I'll start from what I want to achieve: building the googlecast-manager example provided here: https://github.com/googlecast/GameManagerSamples
I followed instructions here: https://developers.google.com/cast/docs/android_sender
So first I downloaded from github the project, then with the Android SDK Manager I downloaded Android Support Libraries and Google play Services. Then in my project, I went to "Open Modules Setting->Add" then went to "Android SDK\extras\android\support\v7\appcompat" and added it.
Then first step to ensure it's working is to build it. So I right clicked on appcompat->"Compile Module Appcompat" but it fails with 2 errors:
Error:(20, -1) android-apt-compiler: [appcompat] D:\Android
SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20:
error: Error retrieving parent for item: No resource found that
matches the given name 'android:Widget.Material.Button.Colored'.
Error:(19, -1) android-apt-compiler: [appcompat] D:\Android
SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base_text.xml:19:
error: Error retrieving parent for item: No resource found that
matches the given name
'android:TextAppearance.Material.Widget.Button.Inverse'.
Doing the same for Google Play works like a charm.
I've tried to find videos/other similar issues but it's either too complicated or not my problem.
Here is the AndroidManifest.xml of appcompat:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.v7.appcompat">
<uses-sdk android:minSdkVersion="9"
android:targetSdkVersion="19"/>
<application />
Here is what is installed from the Android SDK Manager:
I also encountered the same problem and now have fixed it. What you just have to do is
Inside your Android Studio
press Shift button two times, a search box will appear type build.gradle
choose build.gradle module:app from the suggestion.
major version of compileSdkVersion and support libraries under dependencies should be same as following code depict.
Inside Eclipse
find build.gradle module:app and do the same.
Note: download and install properly the latest API which is now API 23.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.inzi.app"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
}
I believe you should upgrade your compileSdkVersion. Check your build.grade file, should be something like:
android {
compileSdkVersion 23 // <- here
buildToolsVersion "23.0.0" // <- here
defaultConfig {
applicationId "your.id"
minSdkVersion 11
targetSdkVersion 23 // <- and maybe here
versionCode 1
versionName "1.0"
}
buildTypes {
....
}
}
Of course you will need to download the newest Android SDK and build tools (and whatever else you need) from the SDK Manager.
If you are working in Eclipse do the following:
In your AndroidManifest.xml file change android:targetSdkVersion to 23
Open Project settings (ALT + Enter while focused in Project Explorer)
Go to Android tab and in Project Build Target section mark Android 6.0
Clean and build your project
NOTE: when you do this have in mind that Android OS would treat your app as if it was designed to work on Android M. So for example if you use some dangerous permissions you should add routines to check then on runtime.
You have to update your SDK to the API 23 that is either not downloaded or not installed properly.
In your build.gradle set
compileSdkVersion 23
buildToolsVersion "23.0.0"
targetSdkVersion 23
compile 'com.android.support:appcompat-v7:23.0.0'
I actually found the answer for my problem and the person above was right. The Module SDK set to compile the module was 22.0 and not 23.0. To fix that I did the following.
Right click on appcompat: "Open Module Setting -> Modules SDK": New. I Chose the folder containing the whole Android SDK and chose the last Android (e.g. 6.0) with the last Module SDK 23.0.
Either revert to appcompact-v22 or update to android api v23
You have to update your SDK to the API 23 that is either not downloaded or not installed properly.
Make sure your compileSdkVersion and dependencies version should be same.
I was having problem with new appcompat V-23 as my target sdk is 21. So I did following two steps and it works perfectly for me..
1) Delete the values-23 folder in res folder.
2) I was getting error on the src folder as well, so commented the only line inside main() of snippet.java as we do not require it.
Then add this project as library to your project.. Hope it helps.
I resolved like below
android {
compileSdkVersion "Google Inc.:Google APIs:21"
buildToolsVersion "23.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
}
replaced the above dependencies with below...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:7.8.0'
}
To correct this error in android studio procceded like this :
i went to sdk manager and i downloaded and updated all packages of android api 23
file => project structure and i changed compile sdk version from 21 to 23 and build tools version from 21 to 23
The problem generally occurs due to version issues. The following dependencies and compilesdkversion Worked for me:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:support-v13:23.0.+'
compile 'com.firebase:firebase-client-android:2.2.4+'
}
The answer #31 & #11 in this discussion can solve this issue:
https://code.google.com/p/android/issues/detail?id=183122
My issue was, one of my un-used dependencies was using sdk-23 version. So after removing those un-used dependencies it worked like a charm.

Android Studio Manifest merger failed minSdkVersion Error

I am trying to add a dependency in my app which has the minimum sdk version newer than my apps so I am getting the following error
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library
Suggestion: use tools:overrideLibrary="com.nononsenseapps.filepicker" to force usage
but I don't know where to add that suggestion so I can build it.
This is how my build.gradle(Module: app) looks right now
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.codedspycamera.android"
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.nononsenseapps:filepicker:+'
compile 'com.squareup.picasso:picasso:2.4.0'
}
com.nononsenseapps.filepicker works only on >=14 version android device. I think it will crash if you force it to work on <14 devices. But anyway if you want to do this, you should force using minSdkVersion params from your main app to override library value. Add suggested line to main app manifest. Read this for more information.
Just to make the answer more clear for everyone this is what you have to do
tools:overrideLibrary marker
A special marker that can only be used with uses-sdk declaration to override importing a library which minimum SDK version is more recent than that application's minimum SDK version.
Without such a marker, the manifest merger will fail. The marker will allow users to select which libraries can be imported ignoring the minimum SDK version.
Example, In the main android manifest :
<uses-sdk android:targetSdkVersion="14" android:minSdkVersion="2"
tools:overrideLibrary="com.example.lib1, com.example.lib2"/>
will allow the library with the following manifest to be imported without error :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib1">
<uses-sdk android:minSdkVersion="4" />
</manifest>
Note that the if multiple libraries are added than they must be separated with a comma ","
For ionic developers
config.xml - add -
<preference name="android-minSdkVersion" value="19" />
bundle.gradle - add
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}
}

INSTALL_FAILED_OLDER_SDK on Android Studio because of Android L [duplicate]

I'm new to Android and I'm using the Android Studio. I've created a new project just to show the Hello World! but I can't get it working on the AVD because of this error: Failure [INSTALL_FAILED_OLDER_SDK].
I already searched for the answer and I know it's something about the build.gradle and the minSdkVersion but any of the answers worked for me.
This is my AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.scoelli.test" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MyActivity"
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>
And this is my build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.scoelli.test"
minSdkVersion 8
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 would appreciate not only the answer but the explanation.
Thank You!
Unless you know you want to be using the Android L developer preview with your application, do not target and compile with it. It is still very much a preview release, and it appears as though applications targeting and compiling for the preview cause this error with any non-L device.
Update these lines in your build.gradle to stick with the latest stable release (Android 4.4, API 19):
android {
compileSdkVersion 19
defaultConfig {
targetSdkVersion 19
}
}
I fixed this problem.
I just modified the compileSdkVersion from android_L to 19
to target my nexus 4.4.4.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
apply plugin: 'com.android.application'
repositories {
jcenter()
}
android {
**compileSdkVersion 'android-L'** modified to 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.antwei.uiframework.ui"
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 'com.android.support:support-v4:21.+'** modified to compile 'com.android.support:support-v4:20.0.0'
}
how to modified the value by ide.
select file->Project Structure -> Facets -> android-gradle and then modified the compile Sdk Version from android_L to 19
sorry I don't have enough reputation to add pictures
I think projects with
compileSdkVersion 'android-L'
cannot be installed in other Android versions right now.
I might be wrong there but if you're not doing anything specific to the L preview SDK, just set the compile version to one of the official ones.
Same goes for the targetSdk.
You can choose those in the Create Project wizard.
If you get this error when compiling Adobe AIR mobile app - just correct "minSdkVersion" this line in the application descriptor xml file:
<uses-sdk android:minSdkVersion="13" android:targetSdkVersion="15"></uses-sdk>

Failure [INSTALL_FAILED_OLDER_SDK] in Android Studio

So I know that many other people had this problem, but mine is a little different. I've tried running my app on an LG G2 with Android 4.4.4, and a Note 3 with Android 4.4.2, but neither worked. I have installed the API 18, 19, and 20 SDKs.
Failure [INSTALL_FAILED_OLDER_SDK]
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.ween.control"
minSdkVersion 8
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 'com.android.support:appcompat-v7:19.+'
}
You can't test an Android-L app on a device with lower API.
Take a look here.
You need to make sure your dependencies are configured targeting the same sdk (also make sure the sdk is supported for the dependency).
As of version .11, the gradle plugin now uses the new manifest merger tool by default which you can use to avoid conflicting configurations when merging manifests from your dependencies while building by specifying <uses-sdk tools:node="replace" /> in your AndroidManifest.xml file.
http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger
credit goes to Eddie Ringle
I was having a similar issue but my device sdk was 19 and it was looking for it to be 20. I changed the sdk from the file > Project Structure > SDK to 19 also I noticed when I was running it had the wear value selected in the top toolbar so I switched that to mobile and Voila.

Manifest Merging Failed: Android Studio

I am not sure what's the issue. I googled and though it was about matching the sdk versions. They are the same as follows:
build.gradle
android {
compileSdkVersion 17
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 4
targetSdkVersion 17
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':slidingMenu')
compile project(':slidingMenu')
compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar')
compile files('libs/Parse-1.4.0.jar')
}
Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gurbani.ujagar"
android:hardwareAccelerated="true"
android:installLocation="preferExternal"
android:versionCode="26"
android:versionName="7.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="17" />
You will be ended up with this error, If your libraries/modules uses different minSdkVersion or targetSdkVersion inside your project.
To find , In which module actual conflicts are happening you can see your Gradle Console output.
Best practice is to have minSdkVersion 8 at least because most of the libraries like play services etc using this.
Please do the following change and sync Project with gradle
Try to Use minsdkVesion 8 in all your build.gradle files as well as AndroidManifest.xml files ans sync.
If it doesn't solves the problem go through your gradle console to and make required changes as per the error shown.
Note : While compilation, your minSdkVersion and targetSdkVersion in AndroidManifest.xml will be overridden by what you have mention in your build.gradle files.
I think slidingMenu library minSdkVersion is greater than yours (minSdkVersion 4). So manifests cant be merged. You cant use library that requires min version 11 (e.g.) in app that works on api version 4.

Categories

Resources