6

I've a Moto 360 and I can't install the wearable app (which is distributed as a beta testing app alongside with a mobile app in the Play Store) in it.

While developing both apps I had no trouble installing it, debugging over bluetooth etc... But when I install the mobile app in my phone through the Play Store the watch doesn't install the wearable app.

Wearable 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'
    }
}

Wearable manifest:

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

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

Mobile 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'
}

Mobile manifest:

...
<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"/>
...

What could it be?

EDIT: Today I've found through the Google Play Console that my wearable app was rejected, but the error message isn't quite specific. I'm following this functionality criteria and this is the email I've received:

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.

So, what's: WR-VF - App has Wear functionality that is visible to the user.?

Thanks.

GuilhE
  • 11,591
  • 16
  • 75
  • 116
  • Can you clarify what your problem is? The title of your question says "not installing **handheld** app" and your first sentence says "can't install the **mobile** app" but then you also say "doesn't install the **wearable** app". Maybe if you spelled out precisely the steps you are taking and where the process is going wrong? Also, please post error messages, if installation fails there should be something in logcat. – Sterling Oct 26 '16 at 14:05
  • @String Post updated, thanks. – GuilhE Oct 26 '16 at 17:57

2 Answers2

0

I ended up finding the solution but forgot to share:

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

Where 'productionRelease' = productFlavor+buildType

EDIT: gradle-plugin-3-0-0-migration

GuilhE
  • 11,591
  • 16
  • 75
  • 116
-1

Your Gradle files don't show any signing details. You must sign both the mobile and wearable apps with the same certificate.

CodeChimp
  • 4,745
  • 6
  • 45
  • 61
  • I do it through the Android Studio when I choose "Generate Signed APK". It signs both apps right? – GuilhE Oct 31 '16 at 11:18
  • 1
    I've never tried signing that way, I suspect it will only sign the mobile one. Change to Grade signing blocks on both modules. Something basic like this should do it http://stackoverflow.com/a/25693134/552539 – CodeChimp Oct 31 '16 at 14:29
  • It should work, see here: https://developer.android.com/training/wearables/apps/packaging.html#Studio – GuilhE Oct 31 '16 at 14:48
  • That states you have to copy the signed wear apk to the res/raw folder of your mobile app, and add a meta tag, have you done those?. Seems an easy step to miss and signing via Gradle is easier. – CodeChimp Oct 31 '16 at 15:39
  • That's the 5th step if I wanted to follow the "Package Manually" instructions. If I want the IDE to do that work for me, I follow the "Package with Android Studio" 4 steps. Eventually I'll try to do it manually to exclude any possibility, but publishing with the "Package with Android Studio" should be enough. – GuilhE Oct 31 '16 at 15:46
  • I've completed the "Package Manually" 5 steps but when I upload de .apk and go to "Price and Distribution" tab and check the Android Wear checkbox, it fails again... fml Google... – GuilhE Nov 03 '16 at 11:51
  • Go for the gradle packing option then, you'll really wonder why you bothered doing it manually once you start using it. – CodeChimp Nov 03 '16 at 11:57