Android TV apk:禁止降级以前使用M权限的设备

Posted

技术标签:

【中文标题】Android TV apk:禁止降级以前使用M权限的设备【英文标题】:Android TV apk: It is forbidden to downgrade devices which previously used M permissions 【发布时间】:2016-07-25 04:04:34 【问题描述】:

我不久前开发了一款适用于手机和平板电脑的应用。几周前,我还为 android TV 创建了一个不同的 APK,并将其作为测试版上传。 TV 应用因某些原因被拒绝(此处不相关)。

几天前,我为手机和电视创建了一个 APK,尝试在 google play 中上传时出现以下错误:

- It is forbidden to downgrade devices which previously used M permissions (target SDK 23 and above) to APKs which use old style permissions (target SDK 22 and below). This occurs in the change from version 33 (target SDK 23) to version 35 (target SDK 22).
- A device with API levels in range 21+ is eligible to receive version 13, which is optimized for higher API levels, but actually receives version 15 because it has a higher version code. This would occur when 
Release track containing any of [BETA] and Screen layouts containing any of [small, normal, large, xlarge] and Features containing all of [android.hardware.MICROPHONE, android.hardware.screen.LANDSCAPE, android.hardware.screen.PORTRAIT, android.software.LEANBACK].
 - A device upgrading from API levels in range 9-20 to API levels in range 21+ would become eligible to receive version 33, which is optimized for higher API levels, but would actually receive version 35 because it has a higher version code. This would occur when 
Release track containing any of [BETA] and Screen layouts containing any of [small, normal, large, xlarge] and 
Features containing all of [android.hardware.MICROPHONE, android.hardware.screen.LANDSCAPE, android.hardware.screen.PORTRAIT, android.software.LEANBACK].
- Some devices are eligible to run multiple APKs. In such a scenario, the device will receive the APK with the higher version code.

我了解到我的电视 APK 使用 targetSDK = 23 是一个问题,而新的 APK 使用的是 targetSDK = 22。

所以现在我停用了电视的 beta APK,但仍然收到以下错误:

It is forbidden to downgrade devices which previously used M permissions (target SDK 23 and above) to APKs which use old style permissions (target SDK 22 and below). This occurs in the change from version 33 (target SDK 23) to version 35 (target SDK 22).
Some devices are eligible to run multiple APKs. In such a scenario, the device will receive the APK with the higher version code.

【问题讨论】:

即使您在 Google Play 上停用该 APK,也不会从任何已安装该应用程序的设备上删除该版本的应用程序。如果我理解正确,第一个测试版在任何人有机会下载它之前就被拒绝了。您可能需要联系 Google 播放器支持并向他们说明情况。 【参考方案1】:

参考Requesting Permissions at Run Time:

在所有版本的 Android 上,您的应用都需要在其应用清单中声明其所需的正常权限和危险权限。但是,该声明的效果因系统版本和您应用的目标 SDK 级别而异

如果您将使用targetSdkVersion 23,则应该更新您的新版本:

<uses-sdk android:targetSdkVersion="23" />

【讨论】:

以上是关于Android TV apk:禁止降级以前使用M权限的设备的主要内容,如果未能解决你的问题,请参考以下文章

在Android 4.2+上使用intent安装apk时启用降级

对 Android TV 和手机的多个 apk 支持

我用android studio创建一个TV项目,打包成apk 后 安装出现如下错误是怎么回事?

Google Play 应用更新 - 无法发布新的 apk

Android通过ADB降级安装软件方法

Android为TV端助力 Linux命令查看包名类名