3

enter image description here

My app crashed while launching. It is working fine in ios.

Package.json is below

{
  "name": "Leave",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "postinstall": "remotedev-debugger --hostname localhost --port 5675 --injectserver"
  },
  "dependencies": {
    "moment": "^2.18.1",
    "native-base": "2.1.1",
    "react": "16.0.0-alpha.6",
    "react-native": "0.43.4",
    "react-native-actionsheet": "^2.1.0",
    "react-native-elements": "0.10.3",
    "react-native-fs": "^2.1.0-rc.1",
    "react-native-i18n": "^1.0.0",
    "react-native-loading-spinner-overlay": "^0.4.4",
    "react-native-maps": "^0.15.2",
    "react-native-message-bar": "^1.6.0",
    "react-native-modal-datetime-picker": "4.2.1",
    "react-native-vector-icons": "4.0.0",
    "react-redux": "5.0.3",
    "redux": "3.6.0",
    "redux-thunk": "2.2.0",
    "superagent": "^3.5.2"
  },
  "devDependencies": {
    "babel-jest": "19.0.0",
    "babel-preset-react-native": "1.9.1",
    "flow-bin": "0.42.0",
    "jest": "19.0.2",
    "react-native-dotenv": "0.0.3",
    "react-test-renderer": "15.4.2",
    "remote-redux-devtools": "^0.5.10",
    "remote-redux-devtools-on-debugger": "^0.7.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

Logs from logcat is given below

com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError: expected dynamic type `int64', but had type `null'
                                                                 at com.facebook.react.bridge.ReadableNativeMap.getInt(Native Method)
                                                                 at com.facebook.react.devsupport.StackTraceHelper.convertJsStackTrace(StackTraceHelper.java:104)
                                                                 at com.facebook.react.devsupport.DevSupportManagerImpl$3.run(DevSupportManagerImpl.java:290)
                                                                 at android.os.Handler.handleCallback(Handler.java:739)
                                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                 at android.os.Looper.loop(Looper.java:148)
                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Please help.

I have try this https://github.com/facebook/react-native/issues/5646 but it was not working for me

4
  • 1
    Check the output of adb logcat, there are usually some useful pointers there. Commented Jun 30, 2017 at 10:09
  • logcat logs are added Commented Jun 30, 2017 at 10:40
  • It looks like some native code is being called from JavaScript with the wrong parameter (namely null instead of a Number). You should check your code and then check if any of your dependencies is triggering the error. Commented Jun 30, 2017 at 13:20
  • issue is with react-native-maps not wrong parameter Commented Jul 3, 2017 at 4:27

2 Answers 2

3

I found the problem the issue is with react-native-maps. Fix is given below

update

"react-native-maps": "^0.15.2"

to

"react-native-maps": "0.15.2".

Also I think "^" will cause problem in other dependencies in future. So I have removed them from my Package.json

Sign up to request clarification or add additional context in comments.

2 Comments

btw, what does ^ mean in package.json?
@Felix ^ means it will update you to the next minor version automatically.
1

I had the same problem, Nikhil's answer put me on the right track, unfortunately it was another dependency that was causing the crash.

It took me some time to pinpoint it, here is how I proceeded.

Step 1 : I removed every ^ before dependency's version number in package.json.

Step 2 : add ^ before ONE dependency's version number

Step 3 : remove dependency from node_modules and reinstall it (npm i)

Step 4 : restart package manager and restart application, if it starts without crashing, go to step 2

Optionnal step : Fix the dependency and send a merge request :)

Hope this helps.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.