Android Studio : Failure [INSTALL_FAILED_OLDER_SDK]
up vote44down votefavorite
11
Today I have downloaded Android Studio v 0.8.0 beta. I am trying to test my app on SDK 17 . Android studio error Failure [INSTALL_FAILED_OLDER_SDK] Here is my android manifest
package="com.vahe_muradyan.notes" >
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name=".Main_Activity"
android:label="@string/app_name" >
It seems that android studio uses configurations in build.gradle.Here is build.gradle
Thanks for providing this :) – animaonline Jun 30 '14 at 20:43
Hmm...for me, this new info just confuses ME even more. I haven't yet even digested what 'Android-L' is. And maybe EVENTUALLY I might want to have various 'product flavors', but right now, I just want to get one or any set of values to load into my Nexus-7, running v4.4.4. My thought was that Google is now discouraging continuing to use the older '' info in the Manifest, because when I put it there, when using Android-Studio 0.8.1, it flashes on the screen that it intends to IGNORE that info, because presumably, it's getting somewhere else now. – Dave Jul 1 '14 at 23:58
3
Is this meant for mobile/build.gradle or wear/build.gradle? Neither seems to work as the IDE complains "cannot resolve symbol 'compileSdkVersion'" – Erik B Jul 2 '14 at 20:56
This is for mobile/build.gradle. Wear is the another project and you can compile his with any other sdk. – Vova K. Jul 3 '14 at 5:07
1
Its giving an error cannot resolve symbol 'compileSdkVersion' in product flavors. – Ravi Jul 3 '14 at 7:37
show5more comments
up vote10down vote
Do those changes in build.gradle file in the wear module
Thanks, I had similar issues. Seems that changing the 'L' to 20 in this mysterious build.gradle file solves the issue. Never thought I'd say this, but I find myself missing Eclipse... – JDS Jul 14 '14 at 16:10
Thanks a lot!! It worked for me... – user1799214 Jul 15 '14 at 8:34
What is the difference between sdk 20 and 'android-L'? – Igor Ganapolsky Jul 23 '14 at 23:59
You can find in the Build.VERSION_CODES following: public static final int KITKAT = 19; public static final int KITKAT_WATCH = 20; public static final int L = 10000; – Vova K. Aug 17 '14 at 7:32
I'm using Android Studio Beta version 0.8.1 and I have the same problem. I now I sold my problem by changing the AVD (I'm using Genymotion) to API 19. and here is my build.gradle file
when you say changing the avd, do you mean the version in the android manifest file? you edited it in a text editor? what was it before? – barlop Aug 27 '14 at 8:25
no, in android studio the way you change "android sdk" is no more in manifest file, but u change it in "gradle.build" file instead.As my experience of the error is that when I set my gradle.build file like defaultConfig { applicationId "com.example.daroath.actionbar" minSdkVersion 14 targetSdkVersion 19 versionCode 1 versionName "1.0" } I need to choose an AVD with API19 or higher to run it. – Daroath Aug 28 '14 at 1:13
add a comment
up vote4down vote
I ran into the same issue and solved it by downloading api level 20 using sdk manager and changing every string that points to android-L. I did it because I dont have a kitkat device and don't want to use emulator. See the image download the marked one.
Do you can use Material theme with these config? – Vova K. Jul 2 '14 at 10:37
for that you will need either emulator or device with material theme – Illegal Argument Jul 2 '14 at 10:53
Aha! Now I see (said the blind man)! So, now no matter what value I put into that new layout, for 'targetSdkVersion', Android Studio pops up an error, asking me to first INSTALL that version of the SDK, and to then re-sync the project. SO: The problem is that, even tho my SDK-manager says that all these various SDKs are installed (they always were), that suddenly this new Android-Studio must be looking in a diff place, to be able to find them. (I don't know the fix yet. Removing all my SDKs from 10 to 20 is NOT recommended, so I'll sit quietly til someone else discovers the needed-tweak.) – Dave Jul 2 '14 at 14:31
@Dave could you explain your problem exactly? the targetsdkversion and the compilesdk version both need to change(no need to specify app version in manifest in AS) according to what you have. I didnot have a android 4.4L device so I changed it. The above works for me so it should work for you too – Illegal ArgumentJul 2 '14 at 14:37
Sorry...so today, I followed your recipe, and got rid of my 'Android-L' crap, and went back to putting numbered sdk-values in. Which is causing a different problem, in that now the builds no longer work...it says it can't find any of my earlier-installed numerical sdks. So, I'm thinking it can ONLY find that newly added Android-L sdk, so when I ask for anything older, I get this other problem. (Sigh.) – Dave Jul 2 '14 at 18:30
show3more comments
up vote2down vote
As mentioned before switching to build 19 is the suggested route here until v20 is "fixed". This thread helped me solve the issue, but it seems similar answers have been posted here as well.https://code.google.com/p/android/issues/detail?id=72840
shareimprove this answer
answered Jul 16 '14 at 5:14
ThorinOakenshield 5128
2nd this. I removed v20 and L of build tools and android image and replaced with 19.1 build tools and Level 19. Then I removed the project and recreated it and now I can run my programs. – wmac Jul 27 '14 at 15:20
add a comment
up vote2down vote
In AndroidManifest.xml worked for me on Android Studio(Beta)0.8.2.
shareimprove this answer
edited Aug 6 '14 at 13:33
VMAtm 12.3k123451
answered Aug 6 '14 at 13:13
KrisAllenU 8923
add a comment
up vote2down vote
Change file AndroidManifest.xml
shareimprove this answer
edited Mar 2 at 10:55
MysticMagicϡ 12.7k63057
answered Jul 18 '14 at 7:37
user3383999 724
add a comment
up vote1down vote
The real issue is that with vanilla Android Studio v 0.8 beta, it only installs/recognize SDK 20 which is android L. In order to target another complieSDK you need to install it via the SDK manager. Once it is set, you can then change the compileSDK to a lower version and it should work.
you may also want to restrict the compatibility library, it needs to be restricted from using the latest version of the library so change the dependecy to something like :
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.
FROM*************
apply plugin: 'com.android.application'
android {
compileSdkVersion 'L' //Avoid String change to 20 without quotes
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.vahe_muradyan.notes"
minSdkVersion 8
targetSdkVersion 'L' //Set your correct Target which is 17 for Android 4.2.2
Just installed Android Studio v 0.8.1 beta and ran into the same problem targeting SDK 19.
Copied 19 from the adt-bundle to android-studio, changed build.gradle to:
compileSdkVersion 19 targetSdkVersion 19
then project -> app -> open module settings (aka project structure): change compile sdk version to 19.
Now works fine.
shareimprove this answer
answered Jul 7 '14 at 1:09
user2509977 314
add a comment
up vote0down vote
Similar to a few posts prior - I went to SDK Manager and uninstalled v20 and version L. Then I installed version 19 and this problem was resolved and I could debug using my android device, no errors.
shareimprove this answer
answered Jul 18 '14 at 21:47
user3844472 1
add a comment
up vote0down vote
Another way to support Android L is to use custom lpreview property for Gradle. For instance:
This way you can build your app with lpreview property for Android L and without it for previous versions.
shareimprove this answer
answered Oct 11 '14 at 20:24
Yuriy Yunikov 1,220725
add a comment
up vote0down vote
I initially went into the SDK Manager and updated all that it had set to update.
I also added in the SDK version for the version of Android I had on the Droid I had...Version 2.3.4(10)
I don't think that really fixed anything, and after a Android Studio restart as recommended after the SDK installs, I changed the minSdkVersion to 8 in the build.gradle file
I was then able to download the application to my Droid.
defaultConfig {
applicationId "com.cmcjr.chuck.droid_u"
minSdkVersion 8
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
This is Android Studio installed on Ubuntu 12.04
shareimprove this answer
answered Oct 22 '14 at 3:26
Chulk Ches 1
add a comment
up vote0down vote
Check the 'minSdkVersion' in your build.gradle
The default project creates it with the latest API, so if you're phone is not yet up-dated (e.g.minSdkVersion 21), which is probably your case.
Make sure the minSdkVersion value matches with the device API version or if the device has a higher one.
Example:
defaultConfig {
applicationId 'xxxxxx'
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
shareimprove this answer
answered Nov 11 '14 at 15:07
Alécio Carvalho 4,30621529
add a comment
up vote0down vote
your device older than minSDK , edit minSdkVersion in build.gradle