Error in Production Build
Hello! Made an application release with the latest version of the package (1.0.2) a couple of days ago. I use firebase-analytics in the application. About 1-2 percent of users started receiving errors with the following stack trace:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at androidx.appcompat.widget.ResourceManagerInternal.createDrawableIfNeeded(ResourceManagerInternal.java:176)
at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:141)
at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:132)
at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:104)
at es.dmoral.toasty.ToastyUtils.getDrawable(ToastyUtils.java:55)
at es.dmoral.toasty.Toasty.error(Toasty.java:242)
at ui.toasty.RNToastyModule.Show(RNToastyModule.java:103)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:165)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:760)
I am not using any other similar library, so I guess the problem is here. I also seem to have encountered a similar problem in react-native-screens (https://github.com/software-mansion/react-native-screens/issues/463#issue-598797663), because there are 97% crashes according to analytics occurring in the background. But my knowledge of native code is too small to figure it out. It would be nice if we could do it for everyone.
P.s. Sorry for my English, I'm using a translator.)
@prscX Have you ever encountered a similar case?
@JerakRus any update on this
@Hamawis Hi, unfortunately I haven't received any response here. And I couldn't fix it myself.