Android Wear App not installed - android

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.

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)

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.

Had the same problem, what helped me was adding
<uses-feature android:name="android.hardware.type.watch" android:required="false"/>
To the mobiles manifest.

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

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.

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

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.

Related

Unable to distribute app on Android Wear in Google Play Developer console

Im trying to submit my newly created Android Wear watch face through Google Play Developer Console. The problem is checkbox "Distribute your app on Android Wear" in pricing and distribution section is disabled. I cant understand why.
What I did:
1) Uploaded screenshot for Android Wear
2) Uploaded 2 APK files in closed Beta releases. Both files are signed with one key, have different version names. First is phone apk with embedded wear apk (minSdkVersion 23), second - standalone wear apk (minSdkVersion 25) has meta-data android:name="com.google.android.wearable.standalone" android:value="true" in manifest file.
Everythings seems fine and app is ready to publish in production, except the "Distribute your app on Android Wear" checkbox which remains disabled.
What Im missing?
I stumbled upon the exact same issue.
I had <uses-feature android:name="android.hardware.type.watch" /> in my manifest
I had <meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" /> in my manifest
minSdk was set to 25
But still the checkbox for Wear distribution was disabled.
For fun I tried editing the HTML with Chrome's inspection tools, and removed the "disabled" attribute from the checkbox. Sure enough, the setting stuck after enabling the checkbox, and now Wear distribution is enabled. Give it a try!
You may want to check Packaging and Distributing Wear Apps and see if you've missed something.
As discussed, aside from specifying APK's version code (standalone Wear and embedded Wear), also check if you've updated your Wear module's build.gradle file to include the following if an existing embedded app has a minimum SDK version of 23:
android {
// Allows you to reference product flavors in your
// phone module's build.gradle file
publishNonDefault true
...
defaultConfig
{
// This is the minSdkVersion of the Wear 1.x embedded app
minSdkVersion 23
...
}
buildTypes {...}
productFlavors {
wear1 {
// Use the defaultConfig value
}
wear2 {
minSdkVersion 25
}
}
}
Also, check Distribute to Android Wear for more information.
I've received the email from Google support saying that they worked on the issue and changed something. They noted that my manifest file for mobile was missing line <uses-feature android:name="android.hardware.type.watch"/>
I only had this line in Wear module manifest.
I've added this line, uploaded a new version with 2 apk files for wear 2.0 and 1.0 and after that checkbox became enabled.
Currently, the official docks for Wear 2.0 don't clearly say that this line should be added to both manifest files.
Also strange that before the problem with this project I managed to successfully upload another Wear 2.0 project to Developer Console (with checkbox enabled), and the line was only in Wear module manifest.
I actually emailed Google about this - it was an issue on their side and they have now fixed it...
If you add <uses-feature android:name="android.hardware.type.watch"/> to your mobile manifest (not wearable manifest) your apk will be distributed only for WEARABLE devices! Don't do it if you want to distribute also for mobile phones.
I have the same problem. Checkbox "Distribute your app on Android Wear" is grey out. I have followed all instructions in App Distribution, added all wearable screenshots and still cannot check the box.
I have contacted support. First they said, that in my wearable manifest in need to replace:
android.hardware.type.watch
with:
android.hardware.type.WATCH
That didn't help. Next they told me, that there is a bug in developer console and it should be resolved by Tuesday May 9th. Unfortunately, they didn't fix anything or they didn't do anything at all.
Next they told me, that I need to add <uses-feature android:name="android.hardware.type.watch"/> to my mobile manifest file. I cannot do it, because apk would then be distributed only for wearable devices.
I have send them my manifest.xml and build.xml for mobile and wearable and waiting for the response.
Before april I have added about 10 wearable apps (also with 2.0 support) and there was no problem.
In my point of view they doesn't know what the problem is and cannot help us. Moreover they instructions App Distribution are out of date and In one place there is info, that minimum SDK should be 23, and few pages below there is sample code with minimum SDK 21.
Your APK requires both tags below as called out in other answers.
However, you still won't be able to check the box if the original APK (without the tags) was uploaded for the release. You must delete that APK and make sure only the APK with all those fields is left.
I made this mistake and had to hack the solution above but couldn't publish afterwards until I deleted the original APK I uploaded without the standalone tag. I asked support and they seemed to verify this.
Anyway, try that before hacking, hope that helps.
Required in your Wear manifest:
Requirement 1:
<uses-feature android:name="android.hardware.type.watch" />
Requirement 2:
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />

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

App is crashing while clicking on app icon

I installed the app through android studio and its working fine, but when I create the apk and then I installed the apk, on some devices my app is crashing.
Can someone know how we can see the logs or errors in case when we installed through apk, in can't debug the app bcos its working that time.
here are few details,
build variant: debug,
my apk name: app-debug.apk,
and I am using 2 3rd party libs as an .aar files
If you have installed the apk also you can able to get the logs if you have connected your device with studio. For that you have set the No Filter in Android Monitor.
In the phones, your app is crashing, don't just install the app by apk there. May be some of your 3rd party dependency is not compatible with those versions or phones.
Debug your app in those phone with cable and check error logs. You will get to know the problem

Android wear not packaging watch app in debug mode

Gradle wrapper version: 2.5
Gradle android plugin: compile 'com.android.tools.build:gradle:1.2.3'
Android Studio: Version 1.2.2
Mobile dependencies:
wearApp project(':wear')
compile 'com.google.android.gms:play-services-base:7.5.0#aar'
compile 'com.google.android.gms:play-services-wearable:7.5.0#aar'
compile "com.android.support:support-v4:22.2.1"
Wear dependencies:
compile 'com.google.android.support:wearable:1.2.0'
compile 'com.google.android.gms:play-services-wearable:7.5.0'
By running assembleDebug, the mobile app gets built and packaged and then the wear app is built and packaged independently. This way, the wear apk does not end up inside the res/raw folder of the mobile app, the manifest is not updated etc.
But, if I run assembleRelease, the wear app is built first and correctly packaged inside the mobile app and installed on the watch.
I though that maybe signing would be the issue. I gave the debug build the same signing config as release (same certificate, keystore etc) but still same behavior.
This happens either using Android Studio or packaging from the command line.
Needless to say, this is very inconvenient since I can't debug the app on either device.
Has anyone ever experienced this behavior? Has anything changed in the gradle plugin that we have to enable to package wear apps in debug mode?
UPDATE: I don't know if my memory is failing me, but I do recall being able to package de app with assembleDebug, deploy to the phone (and consequently to the watch) and being able to attach the debugger on the watch.
I might be mistaken though. What I ended up doing was deploying the apps independently on both devices (through Android Studio) and going from there. It might be that I always did that in the past and the way the documentation is written lead me to believe otherwise. I will still leave this question here for other people.
If I recall correctly, the packaging of wear app inside the phone app is only done for release builds, so that is by design. In reality, when I am developing an app or debugging one, it is a LOT more convenient for me to just use adb to push the wear app; I don't have to constantly increment the version (otherwise the wear app will not be updated), nor I need to build the phone app each time. Is there a reason you cannot do that? Also, is there a reason you say ".. I can't debug the app on either device"?

Android Wear app packing working in emulator?

Hello Stackoverflow community,
I am currently testing the Android Wear SDK and successfully developed my first wearable app using Android Studio. It is obviously part of a handheld app. This handheld app uses different product flavours for free and paid versions that have a different package names. In Android Studio the "development" package name is like com.abcde, while the flavours are com.abcde.free and com.abcde.pro.
The connection between wear app (dev package name is also com.abcde) and handheld is working fine so far, but I have problems with the packaging testing on the wear emulator.
My question: I have packaged the wear app into my release apk using the Gradle wearApp style in the first attempt and the manual style in the second attempt. Using the second attempt increases my apk by the size of the wear app!
However, I cannot see the app on the wear emulator after installing the release apk on my physical device (which is paired via adb forward with the wear emulator). Is this generally possible, or do I also need a physical wear device to test the automatic packaging?
Looking forward to answers. Thank you in advance!
I found the solution for this. It is a problem with the product flavors.
Let's say you have the following flavor configuration for example.
productFlavors {
free {
applicationId "com.myapp.free"
}
pro {
applicationId "com.myapp.pro"
}
}
You can package the wear app by adding this to your handheld apps build.gradle. This is for the pro version:
wearApp project(path: ':wear', configuration: 'proRelease')
And this is for the free release:
wearApp project(path: ':wear', configuration: 'freeRelease')
The solution was found here: https://stackoverflow.com/a/24828264/547268

Categories

Resources