question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't use Analytics.logEvent

See original GitHub issue

using “react”: “15.3.2”, “react-native”: “0.35.0”, “react-native-firebase-analytics”: “^1.0.5” Devices I use is => Android 7.0, API Level: 24

I have followed the README setting and want to use logEvent.

I just use the README sample code to logEvent, but I got this error as below: var Analytics = require('react-native-firebase-analytics'); Analytics.logEvent('view_item', { 'item_id': 'login' });

undefined is not an object (evaluating ‘FIRAnalytics.logEvent’) logEvent index.js:19 <unknown> index.android.js:17 loadModuleImplementation require.js:122 guardedLoadModule require.js:58 _require require.js:49 global code require-0.js:1

Could you help me to figure out what cause this problem? Thank you

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
juellezcommented, Nov 12, 2016

I also ran into this. Fix: add the following to your MainApplication.java file:

import com.evollu.react.fa.FIRAnalyticsPackage; // <-- add this line
import com.facebook.react.ReactPackage;

...

protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          ...
          new FIRAnalyticsPackage()  // <-- add this line
      );
}
0reactions
evollucommented, Sep 29, 2017

looks like you are running it in wrong folder?

Read more comments on GitHub >

github_iconTop Results From Across the Web

analytics().logEvent does not seem to be working on Android
I use firebase analytic in both IOS and Android. in IOS i can see logevent after a fews hours but in android i...
Read more >
Firebase Analytics events from iOS not showing up
Also, be aware that Firebase Console won't show events in real-time (source):. You can view aggregrated statistics about your events in the ...
Read more >
Log events | Google Analytics for Firebase
Analytics automatically logs some events for you; you don't need to add any code to receive them. If your app needs to collect...
Read more >
Google Analytics Event Tracking Tutorial - Optimize Smart
Google Analytics event tracking allows you to track a specific user's activity with a web page element. Get the FREE ebook on 'Event ......
Read more >
FirebaseAnalytics - Expo Documentation
You can use Firebase Analytics in Expo Go to verify that you are logging events ... logEvent('ExpandProfile', { /* * We want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found