Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

minSdk != deviceSdk

I just recently started getting into Android development. I feel this is a very stupid question but I'll shoot anyway since I've spent an hour on this already. I am currently trying to run a project on my device, with no changes to what Android Studio gave me. I think this image should describe my problem better:

enter image description here

When running I get Failure [INSTALL_FAILED_OLDER_SDK].

I can't understand why they are not compatible. Rather, why does minSdk say API 20 when minSdkVersion on build.gradle says 15? I've tried adding uses-sdk on manifest.xml but I figured that would be unnecessary since my build.gradle file will overwrite that (it didn't work also).

Am I missing some kind of setting here?

like image 804
kir Avatar asked Jul 19 '14 23:07

kir


2 Answers

For some reason, using 'L' as the targetSdkVersion makes it so the minSdkVersion is ignored. You should set the targetSdkVersion to something other than L.

like image 150
Code-Apprentice Avatar answered Oct 19 '22 23:10

Code-Apprentice


It's not a bug. It's a feature :).

If you compile against a preview platform, you can only run on a preview platform.

You should set targetSdkVersion and compileSdkVersion to API 19.

You can read more about this problem here:

Issue 72617: Android Studio Compatible: No, minSdk(API 20, Lpreview) != deviceSdk(API 19)

Issue 72453: Setting sdkCompileVersion to 'android-L' creates an apk with 'L' as minSdk regardless of a lower minSdkVersion value

like image 4
Paul Annekov Avatar answered Oct 19 '22 23:10

Paul Annekov