0

I am trying to update my app from Nougat API level 26 to Android Pie, API level 28. I set my targetSdkVersion to 28, and compileSdkVersion to 28. I have also updated all my support library versions to latest (which is also 28). Here is my app's gradle build file:

build.gradle file

The build works fine and I have tested it out on a API level 28 virtual device, Nexus 5X API 28 and Pixel 2 XL API 28.

However, when I upload it to Google Play Console it shows this: API levels is 19-26 but targetSdkVersion is 28

I know that this will mean that there won't be any changes to which devices are compatible (because the previous version was also up to API level 26).

I have tried searching online but I could not find an answer. Most of the search results tell you to update your targetSdkVersion, support library versions and compileSdkVersion to 28, which I have already done. The other half are about the difference between minSdkVersion and targetSdkVersion.

What am I doing wrong here?

Moon Cheesez
  • 2,319
  • 2
  • 19
  • 34
  • Are you aware of [AndroidX](https://developer.android.com/jetpack/androidx/)? – Morrison Chang Jan 04 '19 at 03:21
  • Yes, I am aware of it but I'm intending to move to it later – Moon Cheesez Jan 04 '19 at 03:32
  • I am confused as to what is your question? If you don't use API 28, those calls may have been removed as a part of proguard. – Morrison Chang Jan 04 '19 at 03:43
  • My question is how do I update my app so that it can support Android Pie. I'll try disabling proguard and see what happens – Moon Cheesez Jan 04 '19 at 04:03
  • @MorrisonChang Proguard does not affect it. I have tried adding `useProguard false` in addition to the `minifyEnabled` above. – Moon Cheesez Jan 04 '19 at 04:43
  • I think you are getting confused by the Google Play Console. If you have tested your app on emulator/real device with the appropriate API levels, then it works. Handling what the app does when its uses higher API on a lower device or a depreciated API is also the developer's responsibility. Should you get crashes or poor performance on untested devices you deal with it as there are many thousands of Android devices. Unless you can quote which API 27/28 you are explicitly using, I wouldn't be concerned. – Morrison Chang Jan 04 '19 at 04:48
  • @MorrisonChang Sorry, what I meant is that I just want my app to be downloadable by Android Pie users from the play store. – Moon Cheesez Jan 04 '19 at 05:28
  • I don't see why Android Pie devices would not be able to download your app. See: https://developer.android.com/guide/practices/compatibility and specifically https://developer.android.com/training/basics/supporting-devices/platforms – Morrison Chang Jan 04 '19 at 06:31

2 Answers2

0

First of all, you don't have to put buildTools on Android P, this is not a requirement. Second please make sure you are up to day with the SDK's on your Android Studio. And check this migration guideline provided by Google: https://developer.android.com/about/versions/pie/android-9.0-migration

Dinorah Tovar
  • 468
  • 2
  • 12
  • As far as I know, I have followed that guideline. I can run the app, satisfying the first guideline. I am also using the Android 9 sdk (as shown in the compileSdkVersion). – Moon Cheesez Jan 04 '19 at 05:53
0

After @MorrisonChang linked https://developer.android.com/training/basics/supporting-devices/platforms I checked it out again and found one part that talks about the Android Manifest.

The AndroidManifest.xml file describes details about your app and identifies which versions of Android it supports. Specifically, the minSdkVersion and targetSdkVersion attributes for the element identify the lowest API level with which your app is compatible and the highest API level against which you’ve designed and tested your app.

I thought that the gradle build file will override any SDK version related elements because of here. but I still re-looked at my Android Manifest.

Apparently, my Android Manifest had the line:

<uses-sdk android:maxSdkVersion="26"/>

This set my maximum API level. After increasing it to 28, it worked.

Moon Cheesez
  • 2,319
  • 2
  • 19
  • 34