React-native-navigation: Crash in TitleBarLeftButtonParamsParser.java:20

Created on 6 Dec 2017  ·  6Comments  ·  Source: wix/react-native-navigation

Issue Description

Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
getIconStateFromId
TitleBarLeftButtonParamsParser.java:20
parseSingleButton
TitleBarLeftButtonParamsParser.java:15
setScreenTitleBarLeftButton
NavigationReactModule.java:91
setScreenButtons
NavigationReactModule.java:76
invoke
Method.java
invoke
JavaMethodWrapper.java:363
invoke
JavaModuleWrapper.java:162
run
NativeRunnable.java
handleCallback
Handler.java:739
dispatchMessage
Handler.java:95
dispatchMessage
MessageQueueThreadHandler.java:31
loop
Looper.java:148
run
MessageQueueThreadImpl.java:194
run
Thread.java:818


Environment

  • React Native Navigation version: 1.1.284
  • React Native version: 0.49.4
  • Platform(s) : Android
  • Device info : Emulator Debug

screen shot 2017-12-06 at 10 58 32

🏚 stale

Most helpful comment

Experienced the same issue, on android only. When you specify your left button, you have to add the id. In my case, I had custom back button, without id specified, and had the same error as OP.
Adding id: back helped.

Here's the line that causes that:
https://github.com/wix/react-native-navigation/blob/4648a3bdf9b70b125ada5fac3afc5ce3a45be895/android/app/src/main/java/com/reactnativenavigation/params/parsers/TitleBarLeftButtonParamsParser.java#L20

All 6 comments

We experienced the same issue, and fixed it by adding id property to each navigator button.

@Froelund If added id this component is not showing on android.

Experienced the same issue, on android only. When you specify your left button, you have to add the id. In my case, I had custom back button, without id specified, and had the same error as OP.
Adding id: back helped.

Here's the line that causes that:
https://github.com/wix/react-native-navigation/blob/4648a3bdf9b70b125ada5fac3afc5ce3a45be895/android/app/src/main/java/com/reactnativenavigation/params/parsers/TitleBarLeftButtonParamsParser.java#L20

Seems component: 'example.CustomButton' doesn't work on Android for buttons.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

The issue has been closed for inactivity.

Was this page helpful?
0 / 5 - 0 ratings