Android Studio : Failure [install failed older sdk] up vote44down vote



Download 188.4 Kb.
Date19.06.2017
Size188.4 Kb.
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

apply plugin: 'com.android.application'
android {

compileSdkVersion 'L'

buildToolsVersion "20.0.0"
defaultConfig {

applicationId "com.vahe_muradyan.notes"

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.+'

}

http://i.stack.imgur.com/tksdb.pngandroid gradle android-studio



shareimprove this question

asked Jun 28 '14 at 9:04
https://www.gravatar.com/avatar/74f1c5c2ac15de2f41ee29ecb7192c0a?s=32&d=identicon&r=pg&f=1
Vahe Muradyan
4711313







2

 




Add this code to your AndroidManifest.xml before Haresh Chhelana Jun 28 '14 at 9:24 

  

 




the same error . pkg: /data/local/tmp/com.vahe_muradyan.notes Failure [INSTALL_FAILED_OLDER_SDK] – Vahe Muradyan Jun 28 '14 at 9:33

  

 




which device have you test ? –  Haresh Chhelana Jun 28 '14 at 9:40

  

 




Alcatel 7025D . –  Vahe Muradyan Jun 28 '14 at 9:41

  

 




SDK version 17 , Android 4.2.1 –  Vahe Muradyan Jun 28 '14 at 9:41

show 8 more comments

20 Answers

activeoldestvotes

up vote23down vote

There are my config to support L and old versions of android:

apply plugin: 'com.android.application'


android {

buildToolsVersion "20.0.0"


defaultConfig {

applicationId "com.example.uladzimir_klyshevich.myapplication"

versionCode 1

versionName "1.0"

}

buildTypes {



release {

runProguard false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}



productFlavors {

l {


minSdkVersion 'android-L'

targetSdkVersion 'android-L'

compileSdkVersion 'android-L'

}

old {



minSdkVersion 10

targetSdkVersion 20

//TODO comment second line if build is not compiles for "L"

compileSdkVersion 20

}

}

}


dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

lCompile 'com.android.support:appcompat-v7:21.+'

oldCompile 'com.android.support:appcompat-v7:19.1.0'

}

As result you will have flavors:



oldDebug oldRelease lDebug lRelease

And can install your application on old versions of android.



shareimprove this answer

edited Jul 1 '14 at 11:14
https://www.gravatar.com/avatar/a007be5a61f6aa8f3e85ae2fc18dd66e?s=32&d=identicon&r=pg
Community
1

answered Jun 30 '14 at 10:08
https://www.gravatar.com/avatar/39d48e37757c9636bc6555c57a2e94d2?s=32&d=identicon&r=pg
Vova K.
336212







  

 




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

show 5 more comments

up vote10down vote

Do those changes in build.gradle file in the wear module

compileSdkVersion 20 targetSdkVersion 20

So the final wear/build.gradle content will be:

apply plugin: 'com.android.application'


android {

compileSdkVersion 20

buildToolsVersion "20.0.0"
defaultConfig {

applicationId "your package name"

minSdkVersion 20

targetSdkVersion 20

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.google.android.support:wearable:+'

compile 'com.google.android.gms:play-services-wearable:+'

}

shareimprove this answer

answered Jul 10 '14 at 22:01
https://www.gravatar.com/avatar/1f6074b29bafeac616722a906be11508?s=32&d=identicon&r=pg
HocineHamdi
1194







  

 




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 

add a comment




up vote5down vote

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

apply plugin: 'com.android.application'


android {

compileSdkVersion 19

buildToolsVersion "19.1.0"
defaultConfig {

applicationId "com.example.daroath.actionbar"

minSdkVersion 14

targetSdkVersion 19

versionCode 1

versionName "1.0"

}

buildTypes {



release {

runProguard false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}



}
dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

}

enter image description here

Hope this help!



shareimprove this answer

answered Jul 4 '14 at 14:16
https://www.gravatar.com/avatar/f799a82684fd8d1f3a6bd293736c96a8?s=32&d=identicon&r=pg
Daroath
16819







  

 




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. http://i.stack.imgur.com/gsoh2.png See the image download the marked one.

Here's my build config:

apply plugin: 'com.android.application'
android {

compileSdkVersion 20//changed this from default

buildToolsVersion "20.0.0"
defaultConfig {

applicationId "com.example.subash.test"

minSdkVersion 12//changed this from default

targetSdkVersion 20//changed this from default

versionCode 1

versionName "1.0"

}

buildTypes {



release {

runProguard false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}



}
dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])



}

shareimprove this answer

edited Jul 2 '14 at 3:21


answered Jul 2 '14 at 2:03
http://i.stack.imgur.com/nhqno.png?s=32&g=1
Illegal Argument
5,1452933







  

 




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

show 3 more 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
http://i.stack.imgur.com/hipzm.jpg?s=32&g=1
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
https://www.gravatar.com/avatar/0fcadd26d2b5a64a8c3fee613cfc494e?s=32&d=identicon&r=pg
VMAtm
12.3k123451

answered Aug 6 '14 at 13:13
https://www.gravatar.com/avatar/bc27417caa5521e0bfd9f89c943498c8?s=32&d=identicon&r=pg
KrisAllenU
8923







add a comment




up vote2down vote

Change file AndroidManifest.xml





shareimprove this answer

edited Mar 2 at 10:55
http://i.stack.imgur.com/iwvrn.jpg?s=32&g=1
MysticMagicϡ
12.7k63057

answered Jul 18 '14 at 7:37
https://www.gravatar.com/avatar/64323d12920d7692e20ce92ad4835de6?s=32&d=identicon&r=pg&f=1
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 :

compile('com.android.support:appcompat-v7:19.1.0') {

// really use 19.1.0 even if something else resolves higher

force = true

}


shareimprove this answer

edited Aug 2 '14 at 3:14


answered Aug 2 '14 at 3:05
https://www.gravatar.com/avatar/33d3aae34ff312b2a602552bfc951270?s=32&d=identicon&r=pg
Ajibola
9061221







add a comment




up vote1down vote

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

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.+' // Avoid Generalization

// can lead to dependencies issues remove +

}

TO*************



apply plugin: 'com.android.application'

android { compileSdkVersion 20 buildToolsVersion "20.0.0"

defaultConfig {

applicationId "com.vahe_muradyan.notes"

minSdkVersion 8

targetSdkVersion 17

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.0.0'

}

This is common error from eclipse to now Android Studio 0.8-.8.6 Things to avoid in Android Studio (As for now)



  • Avoid Strings instead set API level/Number

  • Avoid generalizing dependencies + be specific

shareimprove this answer

answered Aug 18 '14 at 9:54
https://www.gravatar.com/avatar/6988a9378d8995b91a14da6125585551?s=32&d=identicon&r=pg
Al-Kathiri Khalid
1063







add a comment

up vote1down vote

I fixed this problem. I just modified the compileSdk Version 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



shareimprove this answer

edited Oct 18 '14 at 6:30


answered Oct 18 '14 at 2:51
https://www.gravatar.com/avatar/9c8393ace035e13fa770cf85b58bb495?s=32&d=identicon&r=pg&f=1
Ant小波
113







add a comment




up vote1down vote

in the AndroidManifest.xml file change the user-sdk to older version 

shareimprove this answer

answered Nov 10 '14 at 11:11
https://lh5.googleusercontent.com/-fle1sckhmzg/aaaaaaaaaai/aaaaaaaaaae/puplvxnort8/photo.jpg?sz=32
youssef
72







add a comment

up vote0down vote

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
https://www.gravatar.com/avatar/42eb5610aad8646a820eec6c7ea00ecf?s=32&d=identicon&r=pg
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
https://www.gravatar.com/avatar/b71c9b1cef8bf9d809a52e69f5003ca8?s=32&d=identicon&r=pg&f=1
user3844472
1







add a comment

up vote0down vote

Another way to support Android L is to use custom lpreview property for Gradle. For instance:

lpreview = hasProperty('lpreview')


apply plugin: 'com.android.application'
android {

compileSdkVersion lpreview ? "android-L" : 19

buildToolsVersion "20.0.0"
productFlavors { lpreview ? lpreview{} : classic{} }
defaultConfig lpreview ? {} : {

minSdkVersion 14

targetSdkVersion 19

}

Now, you can build your app with:



./gradlew clean

./gradlew -Plpreview assembleDebug

or

./gradlew -Plpreview installLpreviewDebug



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
http://i.stack.imgur.com/aduej.jpg?s=32&g=1
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
https://www.gravatar.com/avatar/9131877018bb2f2ad98df04476dc64dc?s=32&d=identicon&r=pg
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
https://www.gravatar.com/avatar/935ebd9a062f77adcd92ed3721cbcccf?s=32&d=identicon&r=pg
Alécio Carvalho
4,30621529







add a comment




up vote0down vote

your device older than minSDK , edit minSdkVersion in build.gradle

shareimprove this answer

answered Jan 13 at 4:15
http://i.stack.imgur.com/a0kiy.jpg?s=32&g=1
meow meo
61678







add a comment

up vote0down vote

Try changing you sdk min version

android:minSdkVersion="4"

android:targetSdkVersion="19" />

shareimprove this answer

edited Mar 2 at 10:55
http://i.stack.imgur.com/iwvrn.jpg?s=32&g=1
MysticMagicϡ
12.7k63057

answered Oct 16 '14 at 20:39
https://www.gravatar.com/avatar/0d6c071660c98398bccd2ee748547515?s=32&d=identicon&r=pg
Guilherme Simão Couto
5717







add a comment




up vote0down vote

One more place where minSdkVersion makes a sense is a flavor:

productFlavors {

dev {

minSdkVersion 22



}

prod {


minSdkVersion 9

}

}



minSdkVersion (22) will not install on development devices with API level older than 22.

shareimprove this answer

answered Mar 30 at 11:39
http://i.stack.imgur.com/nxdle.jpg?s=32&g=1
Vladimir Koltunov
715







add a comment

up vote0down vote

After a lot of research i found the solution for this huge error which i was struggling for 2 days.

Instead of changing the minSdkVerison & targetSdkVersion in build.gradle

Just open the Manifest file and use this

android:minSdkVersion="17"

android:targetSdkVersion="21"/

shareimprove this answer

answered May 5 at 10:13
https://www.gravatar.com/avatar/964e0a7f7df399e64cd75c61745517b6?s=32&d=identicon&r=pg
Goutham
11







add a comment

Top of Form

Your Answer



Bottom of Form

Download 188.4 Kb.

Share with your friends:




The database is protected by copyright ©ininet.org 2020
send message

    Main page