Android: uses-sdk minSdkVersion being ignored by P

2019-05-02 01:19发布

I built a very simple app that consists of about six activities for showing the details of events at a conference. There's not much to it.

However, I know that the app doesn't work well on devices running anything lower than Android 4.0.3. I set the minSdkVersion to "15" and the targetSdkVersion to "18", but when I upload the apk to the Play Store, it tells me that it will run on anything above 7.

Is there something that I'm missing to restrict the app to run only on 4.0.3 and above?

From the AndroidManifest.xml file. This is inside the <manifest> tag.

What it shows when I publish the app to Google Play, in the Developer Console.

From the Google Play Store listing.

1条回答
虎瘦雄心在
2楼-- · 2019-05-02 01:45

Thanks to a tip on Google+, it appears I found the solution. In the build.gradle file, the values for minSdkVersion and targetSdkVersion can be overridden. I'm assuming that this file is generated based on the manifest, and there's a bug in Android Studio that was putting incorrect values here. This is only an assumption.

The following images show what the build.gradle file was like before I altered it, what it looked like after I altered it, and what the Developer Console shows for this new apk after I uploaded it.

build.gradle file before manual edits. build.gradle file after manual edits. Developer Console after new APK upload.

查看更多
登录 后发表回答