Question

React Native app doesnt build when importing fullstory native module on android

  • 19 January 2023
  • 3 replies
  • 76 views

Fullstory doesn’t build on android it fails with the below error:
 

```

 TypeError: null is not an object (evaluating 'FullStory.LogLevel = LogLevel')
 ERROR  Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.

```

has anyone experienced this? If so how did you solve it. Also I see this  If you want to use the Metro Server for local development, we recommend disabling FullStory for these builds. How do i disable the plugin in metro?


I tried this as a hack but not sure its the best way to handle this because android users are always anonymous. I created 2 files :

--- index.ts
```

import FullStory from '@fullstory/react-native';export function fullStoryIndentify(user) {   FullStory.indentify(user.oid, {displayName: user.name, email: user.email})}

```

 

--- index.android.ts
```

import FullStory from '@fullstory/react-native';export function fullStoryIndentify(user) {}

```

 

 


3 replies

I also get this
 

 

Userlevel 4
Badge +3

Hey @ebere this might be worth sending a note to mobile-support@fullstory.com - I recommend referencing your Organization Name or Org ID if you have it too.

Userlevel 4
Badge

Hey @ebere! Thank so much for reaching out! 😊

Also, thank you @stevenshyne for suggesting to reach out to our support team. I see that our team is currently working with @ebere to help resolve this issue. 👍

I’d like to shed some light on what is happening here in the event someone else in our Community comes across a similar roadblock:

FullStory doesn't have full support for Metro server. If you're only using Metro server in your development flow, we suggest disabling our babel plugins in your development builds. Otherwise, the only alternative would be to not use Metro server. But, when building a release app without the Metro server, the javascript will be compiled/bundled ahead of time (what the Metro Bundler is) and we do work with the Metro Bundler and that is when our babel plugins get executed. 

It looks like you’re in good hands with our support team, but please don’t hesitate to reach out should you have any other questions!

Reply