0

To try the new features of API 21, I created a new project with a basic activity.

The SDK version is requested as follows in the AndroidManifest.xml: <uses-sdk android:minSdkVersion="L" android:targetSdkVersion="L"/>.

I have a virtual device created with API 21, as shown here.

However, when building and deploying my project, after selecting my running virtual device in the chooser window, Android Studio uploads the apk, tries to install it and finally abort with this error:

Failure [INSTALL_FAILED_OLDER_SDK]

I tried again with lower minSdkVersion values as advised in this related question, but even targeting minSdkVersion="4" didn't change the output. Moreover, I believe my emulator uses the latest API version, and this should allow me to develop targetting minSdkVersion="L"...

  • What could be the cause of this problem?
  • Is there a solution that would still allow me to use latest API?
Community
  • 1
  • 1
PLNech
  • 3,087
  • 1
  • 23
  • 52

3 Answers3

2

The L SDK version refers to the L developer preview. Any application that targets L will only work on a device running the preview.

You should set your targetSdkVersion to 21 and your minimum to whatever the lowest version is that you actually want to support.

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
1

you are using the old developer preview, change everything from L to 21

tyczj
  • 71,600
  • 54
  • 194
  • 296
1

Try not to write android:targetSdkVersion="L" in manifest .

matthias_h
  • 11,356
  • 9
  • 22
  • 40