可穿戴设备未安装应用(Android Wear 功能标准)

Wearable not installing app (Android Wear functionality criteria)

我有一台 Moto 360,但我无法在其中安装可穿戴应用程序(作为 Beta 测试应用程序与 Play 商店中的移动应用程序一起分发)。

在开发这两个应用程序时,我在安装、通过蓝牙调试等方面都没有遇到任何问题...但是当我通过 Play 商店在我的 phone 中安装移动应用程序时,手表没有安装可穿戴应用程序.

可穿戴gradle:

apply plugin: 'com.android.application'   
android {
    compileSdkVersion 24
    buildToolsVersion "24.0.3"

    dataBinding{
        enabled = true
    }

    defaultConfig {
        applicationId "my.app"
        minSdkVersion 21
        targetSdkVersion 24
        versionCode 56
        versionName "1.0.0"
    }

    ...

    productFlavors {  
        dev {
            applicationId "my.app.dev"
        }
    }

    dependencies {
        compile project(':shared')

        compile 'com.google.android.support:wearable:2.0.0-alpha2'
        compile 'com.google.android.gms:play-services-wearable:9.6.1'
    }
}

可穿戴清单:

...
<uses-feature android:name="android.hardware.type.watch"/>

<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
...

手机gradle:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "my.app"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 56
        versionName "1.0.0"
    }

    ...

    productFlavors {   
        dev {
            applicationId "my.app.dev"
        }
    }
}

...

dependencies {
    compile project(':shared')
    ...
    wearApp project(':wear')
    compile 'com.google.android.gms:play-services-wearable:9.6.1'
}

移动清单:

...
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>

<!--GCM-->
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
...

会是什么?

编辑: 今天我通过 Google Play 控制台发现我的可穿戴应用被拒绝了,但错误消息并不十分具体。我正在关注此 functionality criteria,这是我收到的电子邮件:

Eligibility issues:

-Your app does not have Android Wear functionality that’s visible to the user.

If you’re adding wearable features to notifications, make sure they're triggering when appropriate.

You can review this checklist to make sure your wearable app is packaged correctly:

  • Include all the permissions declared in the manifest file of the wearable app in the manifest file of the mobile app. For example, if you specify the VIBRATE permission for the wearable app, you must also add that permission to the mobile app.
  • Ensure that both the wearable and mobile APKs have the same package name and version number.
  • Sign your app.
  • Test your app on a variety of different Android Wear devices and configurations.

那么,什么是:WR-VF - 应用程序具有用户可见的 Wear 功能。

谢谢。

您的 Gradle 文件未显示任何签名详细信息。您必须使用同一证书签署 移动应用和可穿戴应用。

我最终找到了解决方案,但忘了分享:

dependencies {
    wearApp project(path: ':wear', configuration: 'productionRelease')
    ...
}

其中 'productionRelease' = productFlavor+buildType

编辑: gradle-plugin-3-0-0-migration