react-native-toasty icon indicating copy to clipboard operation
react-native-toasty copied to clipboard

Error in Production Build

Open JerakRus opened this issue 5 years ago • 3 comments

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.

Снимок экрана 2020-09-06 в 17 18 39 Снимок экрана 2020-09-06 в 17 22 26

P.s. Sorry for my English, I'm using a translator.)

JerakRus avatar Sep 06 '20 14:09 JerakRus

@prscX Have you ever encountered a similar case?

JerakRus avatar Sep 10 '20 13:09 JerakRus

@JerakRus any update on this

Hamawis avatar Nov 12 '20 14:11 Hamawis

@Hamawis Hi, unfortunately I haven't received any response here. And I couldn't fix it myself.

JerakRus avatar Nov 17 '20 12:11 JerakRus