1

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

kfir
  • 635
  • 8
  • 27
  • by the way, since mid-July (2021) they only let you release bundles (multi-APK releases are no longer accepted - actually, even single apk releases are off now) - has your Wear OS version been approved? perhaps it needed to pass some of their internal tests prior to you being able to opt in . . ? – Razvan_TK9692 Jul 31 '21 at 01:15
  • I have bundle of 2 APKs. one handy, one wearable. I have been contact by their support. a bot named "Bob" said to add " I have explained that it is in the APK of the wearable in the bundle but that google console do not allow it for the APK of the handy. he answered that he can't help anymore. the problem with their website and automatization. – kfir Aug 01 '21 at 04:28
  • is only for watch-app not for mobile. thats how google distinguish between mobile app and watch app. it is written on their docu. – Emil May 05 '22 at 22:23

2 Answers2

3

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 :-)

Razvan_TK9692
  • 320
  • 1
  • 10
  • I understood this option. BUT - I need the wearable APK to communicate with the phone APK. otherwise - the wearable app makes no sense. and if the 2 do not have same package name - they cannot communicate https://developer.android.com/training/wearables/apps/packaging "If your Wear app has an accompanying phone app, use the same package name for your Wear app and that phone app." If the 2 have the same package name - google play do not allow to create that as separate app. – kfir Aug 03 '21 at 12:08
  • By the way - there is no more "Build > Build Bundle(s) / APK(s)" - apps can only upload bundles. bundles needs to have all APK inside of them. I was thinking to make 2 different bundles like you suggested - but those 2 apps will not be able to communicate between them. which was the only reason I wanted to add wearable app. – kfir Aug 03 '21 at 13:32
  • a bundle doesn't have apks inside, they replace apks; I did upload 2 bundles recently for my Android app and my Wear OS app. And what prevents you from giving the same package name to your Wear OS app, if it's in a different (its own) bundle? – Razvan_TK9692 Aug 05 '21 at 21:50
  • If you analyze the aab\bundle using Android studio - you can find the second APK compress inside the RES directory. who prevernt me =>google developer console prevent me - I took the same project - made a second aab/bundle file - try to upload to different new app, error message : "You need to use a different package name because "com.xxxx.xxxx" is already used by one of your other applications." – kfir Aug 06 '21 at 12:40
  • when uploading the bundles (one for Android, and a different one for Wear OS which has specific declarations in the manifest such as but a different versionCode - just to be sure), you have to upload for the same app in the Play Console. don't create a different app in the console, if that is what you did – Razvan_TK9692 Aug 06 '21 at 15:06
  • Thanks for your patience but I have done all of that. YES - I use different versions long time ago, I have tried bigger or smaller then the handy version (I have updated the original question). also on the manifest of the wearable. If I try to sign and upload the bundle of the wearable instead of the normal app I will get "You can't roll out this release because it doesn't allow any existing users to upgrade to the newly added app bundles." screen recording https://youtu.be/pq9U_RgAaqg – kfir Aug 09 '21 at 08:57
  • when you release on the Play console (for your app project, which has to be the same/shared between the Android handy and Wear OS), if you upload a Wear OS version, you ALSO have to include the Android one even if you didn't update it. Normally you would select it among the list of previously uploaded APKs/bundles. In your video, I don't see anything selectable, which is strange; either you are using a separate app project in the Play console for your Wear OS app variant (which you should not), or perhaps you need to generate an Android bundle as well (they don't allow bundle+APK mixing maybe) – Razvan_TK9692 Aug 09 '21 at 14:36
  • also, if you upload both bundles at the same time (instead of including a previously uploaded version), be aware of potential version issues between the previously uploaded Android version, the new bundle version (add +1), and the Wear OS code version (another +1), so NO version should have the same code number – Razvan_TK9692 Aug 09 '21 at 14:38
  • As explained in my initial post. packaging all in the handheld bundle is useless. that was suppose to be the working solution - but then. since the wearable flag does not exists in the main(handheld) APK - then - the opt in check box is not checkable(can't see on the recording but it is not available). I have made another screen recording with new version numbers https://youtu.be/g6tS1fWBW0k – kfir Aug 09 '21 at 17:37
  • you need TWO bundles to upload: 1 bundle for the Android version, and 1 for the Wear OS version. ok? So, you can have 2 Android Studio projects (1 for the Android handheld version, and 1 for Wear OS), or just 1 project with 2 modules; and for each project, or module, you build a bundle. This should be clear enough, hopefully. In your videos, you only upload 1 bundle, but you need 2. (The confusion lies in Google's definition of a bundle, based on configurations; basically you can have different configurations in a bundle. But Wear OS is not a "configuration", so it requires its own bundle) – Razvan_TK9692 Aug 09 '21 at 22:31
  • You mean that I should take the wearable code - create a complete other android studio project with same package name and same key. I think that android studio - when you choose the wearable app in the edit configuration - do that. it build wearable apk &sign this the wearable bundle but I will give it a try and update. – kfir Aug 10 '21 at 08:55
  • I gave you an alternative, above; either you have 2 projects - or 1 project with 2 modules but you must build a bundle for each module – Razvan_TK9692 Aug 10 '21 at 13:52
  • No - I think it is not that issue. as I showed in the 2 previous videos- I upload once regular bundle and once wearable bundle(they have different file name). I have tried your approach - I have created a new wearable project, copy all files, res & keys. signed and uploaded. same "error: You can't roll out this release because it doesn't allow any existing users to upgrade to the newly added app bundles." error it is about the fact that I lose support for the phones devices - which I want to do for this version. here is a screen recording https://youtu.be/Q8y5OxEosjU – kfir Aug 11 '21 at 14:23
  • it's not 100% clear in the video you just uploaded, but: are you uploading 2 bundles at the same time for your release? my guess is that your Android bundle is missing, so your release would be excluding all of the handhelds! you HAVE TO UPLOAD 2 bundles! (or, upload 1, and include a bundle from a previous release) – Razvan_TK9692 Aug 11 '21 at 14:49
  • 2
    I edited my answer; when you generate your 2 bundles, you click on Generate Signed Bundle / APK; so, you have to do it twice: 1 bundle for Android, and 1 for Wear OS - and you upload both of them in the Play Console, one after the other, in the same release. (unless you can reuse a previously uploaded Android bundle, in addition to your Wear OS bundle, if it appears in the "reuse" list) – Razvan_TK9692 Aug 11 '21 at 23:31
  • 1
    WOW - what you wanted to say - is that when I upload a bundle - need to upload BOTH bundles at the same time!!!! I have created and signed both bundles before but never thought about uploading the same time. google play console was protesting that the phone version have no bundle attached. THANKS – kfir Aug 12 '21 at 07:54
  • yeah, it's something not properly explained in the Wear OS documentation, although quite basic, so I struggled with it too at the beginning. good luck with the review process - that can take a while as well, depending on the level of detail of their feedback - which, in my case, was lacking, so had to submit MANY times before the Wear OS app got approved. . – Razvan_TK9692 Aug 12 '21 at 12:19
  • 1
    Thank you both for this discussion, I have been struggling with this for months and this has helped so much. I also did not realise you had to add 2 separate bundles - I thought the whole point of a "bundle" was to bundle all your modules together into 1 thing. This whole thread demonstrates how confusing this is and how lacking Google's documentation is. – James Allen Sep 07 '21 at 10:08
  • 1
    @Razvan_TK9692 kfir many thanks, you save my life. – Haozes Nov 09 '21 at 14:43
  • May I ask you to take a look at my question regarding a problem regarding publishing wearable apps on the Play Store? I have been stuck for months and looking for similar questions that have been answered but I was not able to resolve my issue. The Google Support wasn't of any help either. – Mohamed El Kayal Nov 29 '21 at 13:30
  • Mohamed El Kayal> will take a look – Razvan_TK9692 Nov 30 '21 at 14:17
3

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! ^^