2

I recently installed android Studio 3.2 Canary 14 for developing for Android P. My minSDK is 15, target is 'P' but running app on Kitkat fails with error

Failure [INSTALL_FAILED_OLDER_SDK] Installation failed since app's minSdkVersion is newer than device's API level (API 19). Please update your apps minSdkVersion. Error while Installing APK

ngenge
  • 157
  • 1
  • 8
  • Possible duplicate of [Changing API level Android Studio](https://stackoverflow.com/questions/19465049/changing-api-level-android-studio) – Rocket Pingu May 17 '18 at 23:43

2 Answers2

2

Google sets it up such that apps compiled against android-P can only run on Android P devices, until we exit the developer previews later this year. The build tools override your minSdkVersion and give it a value of P. You may be able to see this in the "Merged Manifest" tab in Android Studio.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • @CommonsWare, can prevent the build tools from overriding minSdkVersion? It happens to me when I try to compile against android-Q while trying to run it on android P. – Keselme May 05 '19 at 11:38
  • 1
    @Keselme: Not until Beta 4, due out in early June. At that point, the build tools should support the real API level (29), and normal `minSdkVersion` behavior should resume. – CommonsWare May 05 '19 at 11:40
0

Try this

Just make Your compileSdkVersion 'android-P'

and Your targetSdkVersion 27 it will work

AskNilesh
  • 67,701
  • 16
  • 123
  • 163