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