我无法让我的 Android Wear 应用程序运行。每次尝试在手机上打开某些东西时,我都会在 logcat 中不断收到此错误:
W/GooglePlayServicesUtil: Google Play services out of date. Requires 9256000 but found 8701534
我的应用程序应该没有什么问题,因为它以前工作过。当我对我的 LG G Watch 进行出厂重置时,它停止工作。
我用一个应用程序检查了手表上的 Google Play 版本代码,它是(正如 logcat 所说)8701534
。(为什么不更新?)我的手机有版本号9256448
。以下是一些截图:
(点击查看大图)。
这是手表的(缩短的)build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.my.packagename"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.3.0'
compile 'com.google.android.gms:play-services-wearable:9.2.0'
}
这是手机的(缩短的)build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.my.packagename"
minSdkVersion 11
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.google.android.gms:play-services-wearable:9.2.0'
...
}
我已经尝试过通常的方法,例如:
- 手表恢复出厂设置(大约 5 次)
- 清除手机上 Google Play 服务的缓存/数据
- 在手机上重新安装了 Google Play 服务。
- 将手表连接到 3 个不同的设备。请参阅下面的设备名称。
- 让手表保持连接状态约 12 小时。(手机和手表都已连接并在充电器上)。没有改变。
- 改为
compile 'com.google.android.gms:play-services-wearable:9.2.0'
_compile 'com.google.android.gms:play-services-wearable:+'
以下是我尝试过的手机型号,包括手表:
- LG G 手表 LGW100(Android 6.0.1、Android Wear 1.5)
- 华为 Nexus 6P (Android Nougat Preview 4)
- 三星 Galaxy S5 (Android 6.0.1)
- 三星盖乐世 S6 (Android 6.0.1)
我确定这不是电话,因为我将手表连接在三个不同的设备上。
你有什么建议吗?