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.

[Android] Trying to use this library with wix/react-native-navigation throws error: `undefined is not an object (evaluating 'RNGestureHandlerModule.State')`

See original GitHub issue

Thank you for putting together this awesome library 👍

I am facing a small issue while integrating it with react-native-tab-view and wix/react-native-navigation. I raised an issue to here.

I was checking the logs inside Android Studio and get an error saying:

undefined is not an object (evaluating ‘RNGestureHandlerModule.State’)

Relevant stack trace:

03-05 08:42:30.000 12426-12426/com.tabview_example E/unknown:ReactNative: Unable to display loading message because react activity isn't available

03-05 08:42:31.277 12426-12456/com.tabview_example E/ReactNativeJS: undefined is not an object (evaluating 'RNGestureHandlerModule.State')

03-05 08:42:31.282 12426-12426/com.tabview_example E/unknown:ReactNative: Unable to launch redbox because react activity is not available, here is the error that redbox would've displayed: undefined is not an object (evaluating 'RNGestureHandlerModule.State')

03-05 08:42:32.459 2120-2254/system_process E/TaskPersister: File error accessing recents 
directory (directory doesn't exist?).

Here’s the example repo with the change: https://github.com/ghoshabhi/rn-tabview-problem/commit/9d5b1eed6c8ab2adf716094e76a868fa44b016b0

When I run the app - I see a blank white screen with no error (you can see that in the first line of the error trace I have shared)

I am wrapping my navigation screens with the gestureHandlerRootHOC component too.

Am I missing something here ?

react-native: v0.54.0 react-native-gesture-handler: v1.0.0-alpha.41 react-native-tab-view: v0.0.74 react-native-navigation: v1.1.397

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:22 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
im-hamza-devcommented, Dec 8, 2018

For React Native, follow these steps

  1. remove node_modules and package-lock.json

  2. npm install

  3. npm install --save react-navigation

  4. npm install --save react-native-gesture-handler

  5. react-native link

6reactions
OmgDefcommented, Dec 5, 2018

To make it work you need to modify MainApplication.java.

First, import the library : import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; Second, modify getPackages method. It should look like this:

    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
                new RNGestureHandlerPackage()
        );
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Android] Trying to use this library with wix/react-native ...
[Android] Trying to use this library with wix/react-native-navigation throws error: undefined is not an object (evaluating 'RNGestureHandlerModule.State') #128.
Read more >
react native - undefined is not an object (evaluating ...
But while running project I am facing error like this. Here is my Navigation code import { createStackNavigator } from 'react-navigation'; ...
Read more >
[Android] Trying to use this library with wix/react-native-navigation ...
[Android] Trying to use this library with wix/react-native-navigation throws error: `undefined is not an object (evaluating 'RNGestureHandlerModule.State')`
Read more >
undefined is not an object (evaluating ... - Edward Beazer
Ever since React Navigation 3 came out it needs react-native-gesture-handler in order to work. This error usually pops up if Gesture Handler ...
Read more >
Troubleshooting - React Navigation
I'm getting an error "null is not an object (evaluating ... and some similar errors might occur if you didn't link the react-native-gesture-handler...
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