twilio / twilio-voice-react-native

Other
62 stars 22 forks source link

Killed app incoming call app is crashing on Android #341

Closed MykolaKobetiakCloudGenie closed 3 months ago

MykolaKobetiakCloudGenie commented 3 months ago

The incoming call crashes the app if answering from a push notification on the Android.

FATAL EXCEPTION: main Process: PID: 10705 java.lang.RuntimeException: Unable to start receiver com.twiliovoicereactnative.VoiceNotificationReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference at android.app.ActivityThread.handleReceiver(ActivityThread.java:4499) at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2281) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8248) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference at com.twiliovoicereactnative.JSEventEmitter.sendEvent(JSEventEmitter.java:28) at com.twiliovoicereactnative.VoiceNotificationReceiver.sendJSEvent(VoiceNotificationReceiver.java:288) at com.twiliovoicereactnative.VoiceNotificationReceiver.handleIncomingCall(VoiceNotificationReceiver.java:133) at com.twiliovoicereactnative.VoiceNotificationReceiver.onReceive(VoiceNotificationReceiver.java:59) at android.app.ActivityThread.handleReceiver(ActivityThread.java:4490) at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2281)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:205)  at android.os.Looper.loop(Looper.java:294)  at android.app.ActivityThread.main(ActivityThread.java:8248)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)  2024-03-13 15:42:44.135 10705-10705 DevLauncher E DevLauncher tries to handle uncaught exception. java.lang.RuntimeException: Unable to start receiver com.twiliovoicereactnative.VoiceNotificationReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference at android.app.ActivityThread.handleReceiver(ActivityThread.java:4499) at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2281) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8248) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference at com.twiliovoicereactnative.JSEventEmitter.sendEvent(JSEventEmitter.java:28) at com.twiliovoicereactnative.VoiceNotificationReceiver.sendJSEvent(VoiceNotificationReceiver.java:288) at com.twiliovoicereactnative.VoiceNotificationReceiver.handleIncomingCall(VoiceNotificationReceiver.java:133) at com.twiliovoicereactnative.VoiceNotificationReceiver.onReceive(VoiceNotificationReceiver.java:59) at android.app.ActivityThread.handleReceiver(ActivityThread.java:4490) at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2281)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:205)  at android.os.Looper.loop(Looper.java:294)  at android.app.ActivityThread.main(ActivityThread.java:8248)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) 

@twilio/voice-react-native-sdk": "1.0.0-beta.4

mhuynh5757 commented 3 months ago

Hi @MykolaKobetiakCloudGenie thanks for bringing this to our attention. This will be fixed in the next release.

MykolaKobetiakCloudGenie commented 3 months ago

Hi @MykolaKobetiakCloudGenie thanks for bringing this to our attention. This will be fixed in the next release.

Thank you for the reply @mhuynh5757

Do you have any estimates when you are planning the next release?

omerts commented 3 months ago

@mhuynh5757 Was this fixed? or closed by mistake?