The behavior on the Play Store differs depending on whether you specify
`minSdkVersion` in `build.gradle` or `minSdkVersion` in
`AndroidManifest.xml`.
* When `minSdkVersion` is specified in `build.gradle`
If the OS version of the device is lower than the supported version of
the app, a compatible app version will be installed
* example:
In Ver1.0.0.0, `minSdkVersion` was specified as `19`.
If you change `minSdkVersion` to `24` in Ver2.0.0.0, Ver1.0.0.0 will be
installed on devices less than Android7.
* When `minSdkVersion` is specified in `AndroidManifest.xml`
If the OS version of the device is lower than the supported version of
the app, the app page cannot be searched in the Play Store (and therefore
cannot be installed).
* example:
In Ver1.0.0.0, `minSdkVersion` was specified as `19`.
If you change `minSdkVersion` to `24` in Ver2.0.0.0, you cannot search
the app on the Play Store on devices less than Android7.
# What I want to do:
By specifying `minSdkVersion` in `build.gradle`, if the OS version of the
device is lower than the supported version of the app, I want to prevent
the app page from being searched in the Play Store (I want to prevent it
from being installed).
# question:
* The Android Developers site can be read as recommending that you include
the `<uses-sdk>` element in `build.gradle`.Also, since it is written that
the manifest file will be merged, it is considered that there is no
difference in the operation on the Play Store regardless of whether it is
described in `AndroidManifext.xml` or `build.gradle`.
> https://developer.android.com/studio/build/manifest-merge
However, as mentioned above, installation can be prohibited with
`AndroidManifest.xml`, and installation cannot be prohibited with
`build.gradle`.
I would like to know the cause.
* Also, I would like to know how to specify `minSdkVersion` in
`Build.gradle` to prevent the app page from being searched in the Play
Store if the OS version of the device is lower than the supported version
of the app.
# Reproduction procedure
* When specifying `minSdkVersion` in `build.gralde`
```
android {
compileSdkVersion 29
defaultConfig {
applicationId "hoge.fuga.piyo"
minSdkVersion 24
targetSdkVersion 29
versionCode 46
versionName "2.0.0.0"
}
```
* When specifying `minSdkVersion` in `AndroidManifest`
```
<uses-sdk android:minSdkVersion="24" />
```
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/30c2b234-430a-4842-8553-78d8615980e1n%40googlegroups.com.