1
votes

I'm trying to add Firebase Analytics to my wearOS project. Everything works fine for the phone app but when I check the logs for the wearOS version I get this message:

Missing google_app_id. Firebase Analytics disabled.

Since all the code related to Analytics is in a shared module I'm starting to think that Firebase Analytics does not work with wearOS. Am I right?

2

2 Answers

1
votes

It is possible to use Google Analytics for Firebase with Wear OS. Just make sure to include

implement 'com.google.firebase:firebase-core:<version>'

in your gradle file, and you're ready to go.

1
votes

Since Firebase doesn't allow duplicate package names in the same project and your related Android and Wear OS apps' package names should match, you won't be able to have a separate Wear OS app entry in your Firebase project.

https://developer.android.com/training/wearables/apps/packaging#specifying-app-as-standalone

If your Wear 2.0 app has an accompanying phone app, use the same package name for your Wear app and that phone app.

You can use the data layer in order to send data or messages from your Wear OS app to your Android app, then have the Android app trigger events as needed.

https://developer.android.com/training/wearables/data-layer