问题
After adding <compatible-screens>
block to AndroidManifest.xml some devices become incompatible. For example Pixel 3 and Pixel 3a. Both have a density screen 440 DPI. However all other devices from Google are compatible. The thing is I need to support limited set of devices (the UI is not suitable for tablets or devices with low resolutions).
My idea was these devices might belong to
<screen android:screenSize="normal" android:screenDensity="420" />
<screen android:screenSize="normal" android:screenDensity="480" />
or
<screen android:screenSize="large" android:screenDensity="420" />
<screen android:screenSize="large" android:screenDensity="480" />
buckets.
Setting android:screenDensity="440"
is not working. Google Play prohibits uploading apk with such screen density.
Here is a mentioned above complete block of code
<compatible-screens>
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
<screen android:screenSize="normal" android:screenDensity="xxhdpi" />
<screen android:screenSize="normal" android:screenDensity="xxxhdpi" />
<screen android:screenSize="normal" android:screenDensity="420" />
<screen android:screenSize="normal" android:screenDensity="480" />
<screen android:screenSize="normal" android:screenDensity="560" />
<screen android:screenSize="normal" android:screenDensity="640" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<screen android:screenSize="large" android:screenDensity="xxhdpi" />
<screen android:screenSize="large" android:screenDensity="xxxhdpi" />
<screen android:screenSize="large" android:screenDensity="420" />
<screen android:screenSize="large" android:screenDensity="480" />
<screen android:screenSize="large" android:screenDensity="560" />
<screen android:screenSize="large" android:screenDensity="640" />
</compatible-screens>
I was trying to upload apk files with different combinations of screenSize
and screenDensity
and check if those devices become compatible. I have not found it yet.
回答1:
Add below code in AndroidManifest.xml
above application
tag
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
回答2:
There is no value 440
available, while you could still define a minimum screen width in DPI with android:requiresSmallestWidthDp
, with a value larger than the screens to filter out.
https://developer.android.com/guide/topics/manifest/supports-screens-element.html
来源:https://stackoverflow.com/questions/57852700/devices-with-screen-density-440-dpi-are-not-compatible-with-app-being-published