Can't install my app on wear - android

I tried to add a wear module to my existing app, tried a lot of solutions, but can't figure out why my app is not being installed on my watch.
What I tried :
First, Manual packaging with my app : https://developer.android.com/training/wearables/apps/packaging.html
But I quickly decided not to go through this.
Then I decided to go to gradle include, so to the build.gradle of app, I added the following to the end of dependencies :
debugWearApp project(path:':wear', configuration: 'flavor1Debug')
releaseWearApp project(path:':wear', configuration: 'flavor1Release')
To the build.gradle of wear, I added the following to the beginning of dependencies :
wearApp project(':wear')
Then, in android{} section of wear build.gradle, just after buildToolsVersion, I added the following :
publishNonDefault true
What I have seen :
No problem to install the wear app to the wear using bluetooth debug of the wear
Then, when I install a generate a release version of my app, I can see in raw, that it has been added a file android_wear_micro_apk.apk to res/raw which is my watch app.
I also saw a file android_wear_micro_apk.xml in res/xml with, from what I guess between hexa codes, the description of wear app.
Then I compare signatures :
keytool -list -printcert -jarfile mobile_app.apk
keytool -list -printcert -jarfile wear_app.apk
Using the wear app generated in res/raw. They exactly have the same signature. Then I compared :
aapt dump badging mobile_app.apk
aapt dump badging wear_app.apk
They have exact same package names and version codes and names.
So, from that :
Apk of wear is correctly added
Apk of wear is working if installed on the wear using adb and bluetooth debug
Both apk have same version code, version name, and package name
Wear is not requiring any permission
Phone is requesting following permissions
android.permission.ACCESS_NETWORK_STATE
android.permission.INTERNET
com.android.vending.BILLING
com.google.android.c2dm.permission.RECEIVE
android.permission.VIBRATE
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
com.samsung.accessory.permission.ACCESSORY_FRAMEWORK
com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY
com.samsung.WATCH_APP_TYPE.Companion
com.samsung.wmanager.ENABLE_NOTIFICATION
I'm really wondering what I could have forgotten.
Thanks for any help

According to one of Google’s Android Developer Advocates, Android Wear 2.0 will require completely standalone watch and phone apps, and abandons the system used since the first version of Android Wear that automatically installs Android Wear apps based on the apps you have on your phone.
He puts it plainly in reply to another developer in the Android Wear Developers Google+ community (emphasis ours):
A Wear 2.0 user must visit the Play Store on their watch to install
apps. There is no auto-install like on Wear 1.X. Wear 2.0 apps get
full network access and can be installed completely separately from
the handheld app so the focus is much more on standalone Wear apps
than the handheld centric 1.X Wear apps.
But what about apps built solely for your watch? Well, there's a whole
store worth of apps that go beyond simple notifications and live on
the watch itself. Rather oddly, these still have to be installed
through your smartphone. For now, at least - the new Android Wear 2.0
update will include functionality for standalone apps.

Forum
On the watch:
Settings, Un-pair with phone. (Old release of AW may say Factory
reset.)
Do not set up the watch yet.
On the phone:
In Android Wear use the Disconnect... option.
In Android Wear, use Settings, Device settings and touch the watch
name, Touch FORGET WATCH.
Settings, Bluetooth. If you still see the watch, touch Forget... the
watch so it no longer appears in the list of paired devices.
Settings, Device, Apps, select Google Play Services. Clear cache and
Clear data. Uninstall updates.
Settings, Device, Apps, select Google App. Clear cache and Clear
data. Also Uninstall updates.
Settings, Device, Apps, select Android Wear. Clear cache and Clear
data. Also Uninstall updates.
Play Store, Apps, My apps, touch the Update all button.

You may want to check permissions declared in your app. As mentioned in Requesting Permissions on Android Wear regarding mismatching permission models between wearable and handset app,
If your handset app begins using the Android 6.0 (API level 23) model but your wearable app does not, the system downloads the Wear app, but does not install it. The first time the user launches the app, the system prompts them to grant all pending permissions. Once they do so, it installs the app. If your app, for example a watch face, does not have a launcher, the system displays a stream notification asking the user to grant the permissions the app needs.
The suggested solutions in these SO posts might also help:
Android Wear App not installed
Android Wear app not installing through handset

Related

Dependent app configuration Wear Os, gradle vs manifest for distribution

Dependent app configuration Wear Os, gradle vs manifest for distribution
Hello, I need help, this is the first time that I see apps for Wear Os by Google, in this case I made an app dependent on the one on the phone.
Add the settings from the phone and wear app but when you go to "Advanced Settings" -> "Version types" -> Add "Wear Os by Google" and accept the Wear policies, it will be revised and rejected.
The only message I get by mail is the following
Publishing status: Rejected
Your app has not been accepted into Wear OS. This does not affect your app’s status on Google Play.
Eligibility Issue
Does not mention Wear OS
Your app does not mention Wear OS in the store listing. Please refer to the Wear OS by Google app quality guidelines for more information.
So it seems to me that you need some particular configurations either in the manifest or in gradle that I am ignoring, it should be noted that I have been guided by the official documentation but I have not had a satisfactory result.
Thanks in advance!

Run Android wear app

I want to create an Android wearable app on Android studio. I have installed the apk file on mobile to test run it. I would like to know how I can run the same apk on wearable device.Also, apk file created on Studio is different for wearable and mobile devices. How can we run it? Thanks in advance!
As it mentioned at official website you need to create special package signed by release key. See more info about packaging here.
When developing, you install apps directly to the wearable like with handheld apps. Use either adb install or the Play button on Android Studio.
Note: The automatic installation of wearable apps does not work when you are signing apps with a debug key and only works with release keys.
During the development period, do not use release key for signing. Instead, you should build your app which would result in two apks, one for the phone and one for the wear device. Then install each of them separately on the corresponding device using adb or Android Studio. Make sure you are using the same package names for both apks.
When you are done with your development, then build the app with your release key; then the wear apk will be embedded inside your phone apk and installation of your phone apk on a phone will result in the installation of the embedded wear apk on the wear device (make sure you remove the dev apks from both devices prior to this step otherwise installation will fail due to different keys).
Trying to debug through Android Studio as suggested by Julia and Ali, but it is always showing me Parse error while installing or running the code.
I have created a project for both mobile and wear. While running for mobile it works fine in the mobile device but while running the code in the wear it always shows Parse error.
I am using Moto 360 for running and debugging.

Android wearable - how to auto install wearable app

I have created two simple modules in my android project. One module is called handHeld and the other module is called wearable. in the manifest of handHeld i set wearable as a dependency (it was set for me already by the system). I was expecting that when i load handHeld onto a device that it would automatically synch wearable onto the watch but im not seeing that on the emulator (after doing a port fwd). Communication between the watch and device works as i can see notifications appearing and synched. How can i get my wearable app to load onto the watch at the same time as when i install handHeld module onto my device ?
It will only auto-install with an app signed with a release keystore, if you're building the debug version you will need to manually add it to your watch with adb.
Note: The automatic installation of wearable apps does not work when
you are signing apps with a debug key and only works with release
keys. See Packaging Wearable Apps for complete information on how to
properly package wearable apps.
https://developer.android.com/training/wearables/apps/creating.html

"No, missing feature: WATCH" when I try to run my smartphone app with wear app?

I have a smartphone app with a wear app that has been packaged inside of it, similar to the first two steps of this section:
https://developer.android.com/training/wearables/apps/packaging.html#Studio
I was originally told that my smartphone wasn't running an SDK large enough to support the app (my phone was using KitKat, apparently I needed API 20), so now I am using my Nexus 7 with Android L preview, and this problem has appeared:
I have a smartwatch emulator and tablet running, and both are connected using the adb -d forward tcp:5601 tcp:5601 trick, so I have no idea how to fix this now!
How can I get the smartphone app to run and automatically allow the wear app to install onto the emulator?
Please look at this!
May be you should select the APP item before you launch your app.
In your project you have two applications:
Mobile
Wearable
Mobile app should be installed on mobile device (phone/tablet) and Wearable app should be installed on Android Wear device.
This message No, missing feature: WATCH means that you're trying to install Wearable app on mobile phone - you shouldn't do that, your mobile device is not a WATCH. So once again: just launch Mobile app on mobile and Wearable app on Android Wear.
I was originally told that my smartphone wasn't running an SDK large
enough to support the app (my phone was using KitKat, apparently I
needed API 20), so now I am using my Nexus 7 with Android L preview,
and this problem has appeared:
Only the Wearable app should require API level 20, but Mobile app can target any other SDK level (like 10, 14 etc.). You don't need to set higher SDK level for Mobile app only because it supports Wearable app.
How can I get the smartphone app to run and automatically allow the
wear app to install onto the emulator?
As described in the tutorial that you've linked:
If packaged properly, when users download the handheld app, the
system automatically pushes the wearable app to the paired wearable.
But please read the note at the top of this page:
Note: This feature doesn't work when you are signing your apps with a
debug key when developing. While developing, installing apps with adb
install or Android Studio directly to the wearable is required.
This means that automatically installing Wearable app after installing Mobile app (with Wearable app packaged inside) will only work after signing app with your publishing certificate (and not with the debug one - as is done during standard application Launch from Android Studio/Eclipse).
I had the same error when I tried running non wearable application on my device and the error was due to some Android Studio issue with misreading the uses-feature attribute in the Manifest (it reads required false as true):
<uses-feature
android:name="android.hardware.type.watch"
android:required="false"/>
If you remove it from the manifest the error will disappear. I think that it should be already fixed in Android Studio 1.4.1 or 1.5.
Check if you have not open any other android project. I also faced same issue which got solved after I closed android project which has target API greater than watch's.

Deploying Android App To Multiple Test Devices

I exported an unsigned apk file that represents a test version of my Android application. I need to distribute this to quite a few users. Is there a simple method to distribute the apk file where it will install the app? I'm trying to avoid the test users from having to download something like Astro or the sdk. Any ideas? I tried putting it out on a global web server and the file downloads but doesn't install. Thanks for the help!
From the android documentation:
The Android system will not install or run an application that is not
signed appropriately. This applies wherever the Android system is run,
whether on an actual device or on the emulator. For this reason, you
must set up signing for your application before you can run it or
debug it on an emulator or device.
So even if your users have the "Allow installing non-market apps" checked, your application will still have to be signed with at least a test key before it can be installed on a physical device.
I just put my experimental apps on the Android market with a description that says "don't install this, it won't work for you" and then give an access key to my testers.

Categories

Resources