0

This is my package.json file i have install all the dependencies but still have the problem in android

{
  "name": "Free",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/native": "^5.7.4",
    "@react-navigation/stack": "^5.9.1",
    "react": "16.13.1",
    "react-native": "0.63.2",
    "react-native-gesture-handler": "^1.8.0",
    "react-native-safe-area-context": "^3.1.8",
    "react-native-screens": "^2.11.0",
    "react-navigation": "^4.4.1"
  },
  "devDependencies": {
    "@babel/core": "7.11.6",
    "@babel/runtime": "7.11.2",
    "@react-native-community/eslint-config": "1.1.0",**

strong text

**
    "babel-jest": "25.5.1",
    "eslint": "6.8.0",
    "jest": "25.5.4",
    "metro-react-native-babel-preset": "0.59.0",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

I got this error..

TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.Direction')

Any idea?

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
  • a couple of things. 1. you should spend some time with question editor. there are many options to make your question more readable. 2. its just not clear what you are trying to solve here. – Jay Sep 27 '20 at 04:30

1 Answers1

0

Make sure tha you have the following :

MainActivity.java:

import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

And add this inside the MainActivity class, just after protected String

getMainComponentName() function
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}

Then do the following:

cd android
gradlew clean
cd ..

Finally re-run the app: react-native run-android

RowanX
  • 1,272
  • 2
  • 14
  • 27
  • When i run command on cmd prompt This error occur please help i new in react * What went wrong: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 8s MainActivity.java import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; error cannot resovle symbol "swmansion" please tell me the solution Sir] – Abraham Peter Sep 27 '20 at 19:15
  • Check these answers for this specific error: https://stackoverflow.com/questions/60844245/how-solve-could-not-initialize-class-org-codehaus-groovy-reflection-reflectionc and let me know what happened – RowanX Sep 28 '20 at 10:17