martincik/react-native-hockeyapp

Null pointer exception during call to HockeyApp.start() on Android

sarmadka opened this issue · 0 comments

The exception is happening while calling currentActivity.getClass() inside RNHockeyAppModule.start method. We are calling the start method from inside componentDidMount of our app's main component, just like the documentation suggests. The configure is called from componentWillMount. The following is the call stack reported by the HockeyApp crash report:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
	at com.slowpath.hockeyapp.RNHockeyAppModule.start(RNHockeyAppModule.java:105)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:318)
	at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
	at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
	at android.os.Looper.loop(Looper.java:158)
	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
	at java.lang.Thread.run(Thread.java:818)

Additional info:
react-native version: 0.35.0
react-native-hockeyapp version: 0.5.0
android version: 6.0.1
device: Samsung (SM-G900V)