Firebase analytics not logging react native app activities

54 Views Asked by At

I'm currently working on a React Native app using Expo Go and have successfully integrated Firebase for authentication and database functionality. However, I'm facing issues with Firebase Analytics. I followed the instructions on https://rnfirebase.io/analytics/usage to integrate analytics into my React Native app.

Here's the relevant code snippet where I'm trying to log an event:

analytics().logEvent('TakePicture', {
  user: auth.currentUser?.email
});

Unfortunately, when I run this code, I encounter the following error:

[Error: You attempted to use a firebase module that's not installed on your Android project by calling firebase.app().

Ensure you have:

1) imported the 'io.invertase.firebase.app.ReactNativeFirebaseAppPackage' module in your 'MainApplication.java' file.

2) Added the 'new ReactNativeFirebaseAppPackage()' line inside of the RN 'getPackages()' method list.

The issue is that I'm using Expo, and I don't have any Java files, as Expo handles the build process.

I would appreciate any guidance on resolving this Firebase Analytics issue in the Expo environment. Thank you!

I have tried installing packages as described here: https://rnfirebase.io/analytics/usage

0

There are 0 best solutions below