21

we release our first Wearable Application today but sadly this one isn't get installed automatically as it should.

We double checked the APK and the wearable apk is present but never hits the watch. Manually packaging the APK as suggested here http://android-developers.blogspot.de/2014/07/update-on-android-wear-paid-apps.html doesn't helped either. (We know this should only affect paid apps but just to be sure)

Is anybody else facing this issue? The app works if we install the APKs over adb.

onigunn
  • 4,730
  • 10
  • 58
  • 89
  • 1
    Probably a silly question, but maybe you still have the debug app installed? In that case I guess it wouldn't be installed because of differing signatures. – matiash Jul 10 '14 at 23:14

7 Answers7

22
  • Check your permissions. The Smartphone part needs to have all the permissions the Wear component has.
  • use the same package id for both apps (wear and mobile)
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • After updating Android Studio to the latest version and adding a missing permission to the Smartphone app it works. So I guess that was the problem. Strange that there were no error messages in logcat. – onigunn Jul 11 '14 at 20:23
  • @onigum: Can you let me know what was the missing permission that added to your wear app manifest? I have strange issue is it similar: http://stackoverflow.com/questions/24798599/syncing-mobile-app-to-android-wear – TheDevMan Jul 18 '14 at 02:22
  • @TheDevMan he means that: all permissions that are declared in Wearable app have to be included in mobile app. In other words: your mobile app should gather all permissions: these used in mobile app + these used by wearable app. – Maciej Ciemięga Jul 18 '14 at 17:07
  • @MaciejCiemięga I don't have any permission other than the bootcamp which is already there in my mobile App... I have also entered in both mobile and wear.. both have the same package name but still I have the issue.. – TheDevMan Jul 18 '14 at 17:12
  • @MaciejCiemięga: I have just one button in my Android wear project and when I press the button I receive the data in my phone. It is working fine in debug mode. Do I need to do anything my phone app stating the wear connect send install the app in the android wear? – TheDevMan Jul 21 '14 at 09:25
  • This is very buggy... Sometimes it takes a long time also. I even resetted my Wear watch. – powder366 Jul 23 '15 at 08:52
8

I spend ages on this. The wearApp gradle rule worked fine for me. But then for the Paid version of the app, following the guide on the blog to manually package the wear app, it wouldn't auto-load on the wearable. After lots of checking, I found that the wearApp gradle rule (on Android Studio 0.8.2), did actually place the wearable APK in the raw folder as per the blog post fix. So seems to be fixed in latest Android Studio (without being told?). And for some reason, manually packaging the APKs didn't work.

So use the wearApp gradle rule.

Also, if you need to reference a different version of the wear APK for different handheld APK versions (for free and pro versions to have applicationId that matches the wearable version), use the productFlavors in the wear gradle config:

productFlavors {
    freeapp {
        applicationId "com.barkside.appfree"
    }

    proapp {
        applicationId "com.barkside.apppro"
    }
}

Then in your Pro version gradle (for example), have the wearApp dependency target a particular configuration:

wearApp project(path: ':wear', configuration: 'proappRelease')

You will also need publishNonDefault true in the android block of the wear gradle.

barkside
  • 3,951
  • 4
  • 23
  • 32
  • 3
    Is there any documentation for this? `wearApp project(path: ':wear', configuration: 'proappRelease')` – Gak2 Sep 03 '14 at 17:44
  • 1
    When I do wearApp project(path: ':wear', configuration: 'freeRelease') I have an error Error:(63, 0) Build script error, unsupported Gradle DSL method found: 'project()'! Any idea about this ? – jaumard Dec 06 '14 at 11:28
  • 1
    Ye, I had the same issue, but I had flavors in both handheld and wear modules, and I used this http://stackoverflow.com/a/37657444/4128308 – PavelGP Jun 06 '16 at 12:31
  • Documentation for this can be found here: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-Publication – Joen93 Jul 19 '16 at 09:39
6

Had the same problem, what helped me was adding

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

To the mobiles manifest.

Oleksiy Martynov
  • 379
  • 2
  • 11
3

What worked for me was removing product flavors. Sucks that I can't have flavor-specific code now, but Android refuses to package the wear app in release otherwise.

See: Android Wear app not installing through handset

Community
  • 1
  • 1
zhicong
  • 171
  • 1
  • 6
1

You should check adb logcat on both devices to see what is going on. It will give error messages to indicate what problem might be happening.

Also, when you are testing locally, you should only adb install the phone APK to the phone, and let it install the embedded APK to the wearable device. Then you don't need to go all the way through the play store for testing. Make sure you do release builds, because those are the only ones that do the embedded APK with the wearApp() gradle rule.

Wayne Piekarski
  • 3,203
  • 18
  • 19
  • I was having an identical issue, and the adb logs provided no useful information. I would see a line that seemed to indicate it was sending the app to the watch, and the watch adb log had nothing. In my case I didn't have permissions matched between mobile and wear apps. You are correct though, when set up properly it will install to the watch with a signed release build. No need to release all the way to the play store to test. – Jeff Jul 15 '14 at 22:51
  • @JeffTyson:Can you let me know what was the missing permission that added to your wear app manifest? I have strange issue is it similar: http://stackoverflow.com/questions/24798599/syncing-mobile-app-to-android-wear – TheDevMan Jul 18 '14 at 02:27
0

I had a problem with installing an app, i think because my watch reset when it was installing. I had to desvinculate the watch, after reinstall everything it works. Maybe help someone

Alberto Perez
  • 1,019
  • 15
  • 17
-1

This is going to sound like such a basic and silly answer. But when I did my tests, I forgot that in Android Studios where you click on the play button to run your app, you can change it from mobile to wear. I was only ever installing the mobile app and not the wear app on the wear device.

Hope this helps someone.

N1234
  • 468
  • 5
  • 12