app not showing in Android wear start menu - android

I am creating an app that supports both mobile and wearable.
What I have done so far is:
correctly included wear module in build.gradle as mentioned here
added correct dependedncies and support libraries for wearables
same package name and application id both both - wear and mobile modules
same permissions in both manifest
added meta-data for wearable app launcher icon as suggested here
installed signed apk in device.
But, still my launcher icon is not showing in Android Wear start menu.
I have checked all above mentioned things twice. Is anything missing? Any help will be appreciated.

Related

Can't install my app on wear

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

Android: missing feature watch error

I developed wear app and mobile app separate with the same package name. After that I embedded the signed wear apk to the Mobile app SDK.
After embedded when I try to run into mobile am getting an error "MISSING features watch"
For embedded am following
1. Copy the signed wearable app to your handheld project's res/raw directory
2. Create a res/xml/wearable_app_desc.xml
<wearableApp package="wearable.app.package.name">
<versionCode>1</versionCode>
<versionName>1.0</versionName>
<rawPathResId>wearable_app</rawPathResId>
</wearableApp>
Add a meta-data tag to your handheld app's application tag
Am not getting why the issue occurs.am using all the user permission which i used in the wear sdk in mobile sdk
Please help me to solve the issue
Solution 1:
I don't know whether you are giving the below feature tag in the AndroidManifest.xml file in the wearable app module. If not, please give it which will solve your problem.
<uses-feature android:name="android.hardware.type.watch"/>
Solution 2:
If you are having different flavours for your mobile app and having only one flavour for the wear app, you need to use the application id of the flavour you used in mobile app in the wear app.
For example: Say you are having two flavors for mobile app
1. com.wear.app.prod
2. com.wear.app.dev
If you are using com.wear.app.prod, the same should be used for your wear app. If you changed to com.wear.app.dev, then the application id of the wear app should be changed to com.wear.app.dev.
Note: This is for apps having only one flavour for wear app and multiple flavours for the mobile app.
in android studio beside device chose, you can chose your package, select the app , not the wear module and run the project.

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

How to package the wearable apps?

Hy I am trying to package the wearable app using Android studio 1.0.1 and I am following the steps given on this link https://developer.android.com/training/wearables/apps/packaging.html and I followed the steps over 3 successfully . but when go for 4th step , that is to click the Build menu on AS and to click the signed apk , but after that I got a selection box , weather to sign the mobile apk or to sign the wear app.
Now this is a point which is confusing for me , Should I go for Mobile app and It is all done and I would be able then to install the app on mobile and it will push the wear app to wearable or should I first signed the wear app and then paste this signed app in the mobile app and then select the sign mobile app , ??? what should I do to make it work
I think that my question is quite clear now. waiting for help
You have to simply create a module of your wear app with the same applicationId. In addition you add to your gradle script file of your mobile app:
dependencies {
//something bla bla
wearApp project(':mywearable')
}
Generete from Android Studio menu your release APK for your mobile app. You'll see actually that two apk are generated, the mobile and the wear apk but it's only a convenience for you. If you check the mobile apk you'll see the wear app inside, so don't worry use always to publish the mobile apk.
You should build and sign your just mobile application. Wearable aplication will be signed automatically and introduced inside mobile .apk
You could check this opening the .Apk generated as a .zip. Wear apk will be in res/raw/ folder.

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

Categories

Resources