这真的很奇怪。我佩戴表盘的移动伴侣正在显示我从未注册过的权限。我只包含了表盘所需的AndroidManifest.xml中的基本权限,包括振动权限。即使我删除了测试输出的每个权限,它也会显示:
我不确定是否有这个问题,但我确实从我的应用程序中包含了一些来自这位优秀绅士的外部帮助,这需要我将其添加到我的gradle依赖项中:
compile 'me.denley.wearpreferenceactivity:wearpreferenceactivity:0.4.0'
我使用的类集的链接是: https://github.com/denley/WearPreferenceActivity
以下是我的移动模块的简短AndroidManifest.xml。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.floralwatchface" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".FloralMobileConfigActivity"
android:label="@string/app_name">
<intent-filter>
<category
android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
</manifest>
任何建议表示赞赏。
编辑:
Wear gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.test.floralwatchface"
minSdkVersion 19
targetSdkVersion 22
versionCode 7
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'me.denley.wearpreferenceactivity:wearpreferenceactivity:0.4.0'
compile 'com.google.android.support:wearable:1.1.0'
compile 'com.google.android.gms:play-services-wearable:7.3.0'
}
移动gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.test.floralwatchface"
minSdkVersion 19
targetSdkVersion 22
versionCode 7
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.google.android.gms:play-services:+'
}