Instabug / Instabug-React-Native

In-app feedback and bug reporting tool for React Native
https://instabug.com/platforms/react-native
MIT License
308 stars 100 forks source link

Android crashes when calling Instabug.init #1182

Closed JohnGoodman closed 3 months ago

JohnGoodman commented 3 months ago

Using Instabug 12.2.0 ( but also tried with 12.8.0 and had the same issue ) and react native 0.73.6.

I run yarn android and the app builds. Open the app and it crashes and shows nothing in the metro logs. There is a Logcat error shown below. The culprit seems to be Instabug.init({token: instabugKey});. If I comment out that line, the app runs as expected. The instabugKey variable is set and Instabug itself is loaded.

Logcat error

java.lang.NullPointerException: Attempt to invoke interface method 'int com.facebook.react.bridge.ReadableArray.size()' on a null object reference
at com.instabug.reactlibrary.utils.ArrayUtil.parseReadableArrayOfStrings(ArrayUtil.java:159)
at com.instabug.reactlibrary.RNInstabugReactnativeModule$2.run(RNInstabugReactnativeModule.java:121)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
stale[bot] commented 3 months ago

This issue has been automatically marked as pending feedback because we need additional information to be able to investigate it further. It will be closed in 7 days if it remains inactive. Thank you for your contributions.

JohnGoodman commented 3 months ago

The issue was related to having an older version of CrashReporting within my app. It was failing silently so there was no indication that was the problem. After digging into the docs more, I found that I was using an older version of CrashReporting. After updating, this package works on Android again.