kfir
kfir

Reputation: 745

WearOS - distribution - How to prepare my app for the wearOS opt in?

How to prepare my app for the wearOS module opt in?

In my handy manifest: nothing

Handy build:

versionCode 56
versionName "1.0.56"
applicationId "com.arbelsolutions.myapplication"
wearApp project(":wear")

In the wearOS manifest:

<uses-feature android:name="android.hardware.type.watch" />
<uses-library
            android:name="com.google.android.wearable"
            android:required="true" />
<meta-data
    android:name="com.google.android.wearable.standalone"
    android:value="true" />

Wear Build

versionCode 57
versionName "1.0.57"
applicationId "com.arbelsolutions.myapplication"

I have upload the bundle to opt in from the Advanced tab - wear OS - nothing changed.

The opt in check box is greyed out. I have contacted support chat - they do not know. They told me they will return me an email. its been a week - and still no respond. Anybody? the greyed check box

Advanced google play console

On my release folder I have a new bundle which is 2 Mega more then before - looks like it have the wearOS packed inside. WearOS APK was also created in the release folder - Maybe I should upload the wearos APK - it is written " Upload a Wear OS app bundle or APK to a test track" ? But the google docs say no way - they say to upload the bundle only.

EDIT I: I have tried all solutions from the following: Stackoverflow - almost the same issue Nothing helps - got the same answer from google support (to add the <uses-feature android:name="android.hardware.type.watch"/> to the phone manifest ) - but then - google play console do not allow me to upload this bundle

Upvotes: 1

Views: 1662

Answers (3)

claired4l
claired4l

Reputation: 64

In addition to the previous answers, in 2024 you need to create an additional form factor (near the place where you create new release): enter image description here

Then you can upload your bundles to the corresponding form factors. A form factor can still contain several bundles (.aab files), e.g. in case of different minSdk flavours in my case.

About the version codes, I would recommend using offsets, e.g. 100000 for the wear app (and 200000 for the other flavour if you have several of them) so that you don't have to share the version number space between the phone app and the wear app.

Upvotes: 2

Rostislav Litovkin
Rostislav Litovkin

Reputation: 31

I have figured out the problem <3 proof that it worked

  1. It is super confusing.
  2. Info about the solution is from here: https://developer.android.com/training/wearables/overlays/standalone-apps

You will need to create 2 .aab files. Both will have the same com.companyname.example package id.

The first will be just normal android app.

The second one will be a wearOS app. It can use the "same" code, however you need to change these things in manifest.xml:

include:

<manifest>
...
**<uses-feature android:name="android.hardware.type.watch" />** // add this thing
...
<application>
    ...
    **<meta-data
        android:name="com.google.android.wearable.standalone"
       android:value="true" />** // and add this thing too
    ...
</application>
...
</manifest>

and also raise a version code by one. Otherwise google will complain that you already had the same version code. Hope it helped. I spent the whole month researching these shits and finally I have done it! ^^

Upvotes: 3

Razvan_TK9692
Razvan_TK9692

Reputation: 340

Now I think I know what your problem is, because I had it before, and the Android documentation doesn't clearly remove the ambiguity; when saying that a bundle caters to different configurations, etc. it would also imply, in my view, that Wear OS is one such configuration, so should consist in a module inside 1 project. Well, NO! By configuration they just mean different screen sizes, density, etc.

So, what you need when releasing/deploying is really 2 BUNDLES: 1 for Android (phones) and 1 for Wear OS - instead of 1 bundle with 2 modules.

And you can relax about making those "bundles", in contrast with making APKs; sounds more scary than it is. In your two projects (now you will have to have a different project for Wear OS, unless you can perhaps build from each module inside 1 project, but I reverted to 2 projects personally, to make things more clear - the upside of keeping 1 project is that you can use the same code maybe, via a common library...), instead of building an APK, just build a bundle (Build > Generate Signed Bundle / APK and choose Bundle) - that's literally it.

Up to you to arrange several configurations. . but you don't have to :-)

Upvotes: 3

Related Questions