Android Wear 应用说它需要我的清单中没有的权限

Android Wear app says it requires permissions that aren't in my manifest

我正在制作一个我计划很快发布的表盘,但是当移动端安装时我无法安装可穿戴组件(有点重要 :p)。这是我在 Nexus 5X 运行 Android Marshmallow 上安装带有嵌入式可穿戴 apk 的已签名 apk 时正在测试的手表的堆栈跟踪的一部分:

10-13 20:43:50.293    2279-8109/? I/PkgMgrInstallUtil﹕ Sending install intent to PackageInstaller Intent { act=android.intent.action.INSTALL_PACKAGE dat=content://com.google.android.clockwork.home.provider/host/com.twintitanium.watchfaces.cardswatchface/wearable/com.twintitanium.watchfaces.cardswatchface/apk typ=vnd.android.cursor.item/wearable_apk cmp=com.android.packageinstaller/.wear.WearPackageInstallerService (has extras) } forcom.twintitanium.watchfaces.cardswatchface
10-13 20:43:51.168    7981-8110/? W/WearPkgInstallerService﹕ Wearable com.twintitanium.watchfaces.cardswatchface has a permission "android.permission.WRITE_EXTERNAL_STORAGE" that is not granted in the host application.
10-13 20:43:51.168    7981-8110/? W/WearPkgInstallerService﹕ Wearable com.twintitanium.watchfaces.cardswatchface has a permission "android.permission.READ_EXTERNAL_STORAGE" that is not granted in the host application.
10-13 20:43:51.168    7981-8110/? W/WearPkgInstallerService﹕ Wearable com.twintitanium.watchfaces.cardswatchface has a permission "android.permission.GET_ACCOUNTS" that is not granted in the host application.

事实上,如果我在 phone(卡片表盘)的设置下转到安装的应用程序,我会看到 2 个权限,联系人和存储,被禁用。

似乎不言自明,只是我的可穿戴清单中没有任何这些权限 - 我只有 "com.google.android.permission.PROVIDE_BACKGROUND" 和 "android.permission.WAKE_LOCK,",因为它们是表盘所必需的。如果我尝试将这些权限添加到我的移动和可穿戴清单中,它仍然会出现相同的错误。

这是一个新问题,因为我在 Play 商店上有一个测试版可以使用,但后来我更新到 API 23。这可能是什么原因造成的?

检查您的 build.gradle 文件:如果您对 'com.google.android.gms:play-services:8.1.0' 有依赖性,它显然从 Google Play Services 7.5 开始隐式添加权限(在本例中为联系人和存储)。将该依赖项更改为特定组件 'com.google.android.gms:play-services-wearable:8.1.0' 将摆脱这些权限(并使您的 apk 更小,因为它不会包含它不使用的库)。