iamolegga / react-native-launch-arguments

Get launch arguments for testing with Detox and Appium
MIT License
55 stars 21 forks source link

[Android] App is crashing on launch when opening from an URL #39

Open renchap opened 2 years ago

renchap commented 2 years ago

When the app is started from opening an URL, it crashes with:

07-28 18:32:19.135 10708 10758 W Bundle  : Key android.support.customtabs.extra.SESSION expected String but value was a android.os.BinderProxy.  The default value <null> was returned.
07-28 18:32:19.135 10708 10758 W Bundle  : Attempt to cast generated internal exception:
07-28 18:32:19.135 10708 10758 W Bundle  : java.lang.ClassCastException: android.os.BinderProxy cannot be cast to java.lang.String
07-28 18:32:19.135 10708 10758 W Bundle  :  at android.os.BaseBundle.getString(BaseBundle.java:1199)
07-28 18:32:19.135 10708 10758 W Bundle  :  at com.reactnativelauncharguments.LaunchArgumentsModule.getConstants(LaunchArgumentsModule.java:14)
07-28 18:32:19.135 10708 10758 W Bundle  :  at com.facebook.react.bridge.JavaModuleWrapper.getConstants(JavaModuleWrapper.java:14)
07-28 18:32:19.135 10708 10758 W Bundle  :  at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
07-28 18:32:19.135 10708 10758 W Bundle  :  at android.os.Handler.handleCallback(Handler.java:938)
07-28 18:32:19.135 10708 10758 W Bundle  :  at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 18:32:19.135 10708 10758 W Bundle  :  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1)
07-28 18:32:19.135 10708 10758 W Bundle  :  at android.os.Looper.loopOnce(Looper.java:201)
07-28 18:32:19.135 10708 10758 W Bundle  :  at android.os.Looper.loop(Looper.java:288)
07-28 18:32:19.135 10708 10758 W Bundle  :  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:8)
07-28 18:32:19.135 10708 10758 W Bundle  :  at java.lang.Thread.run(Thread.java:920)
07-28 18:32:19.137 10708 10758 E ReactNativeJS: Error: Exception in HostObject::get for prop 'LaunchArguments': java.lang.IllegalArgumentException: Could not convert class android.app.PendingIntent, js engine: hermes

Version is Android 12, I am not sure how to get the full Intent that is causing the app to crash.

Christophe235 commented 2 years ago

Same issue here! 🤚 I'm able to reproduce this by opening a deeplink to my application through slack. When I try to do it through other apps such as email, SMS or even the notes device application the app opens with no issues.

Also, I noticed that from Slack side the Intent is coming with extras that contain this BinderProxy: Bundle[{android.support.customtabs.extra.SESSION=android.os.BinderProxy@2a28f88, android.support.customtabs.extra.TITLE_VISIBILITY=1, android.support.customtabs.extra.MENU_ITEMS=[Bundle[mParcelledData.dataSize=364], Bundle[mParcelledData.dataSize=352], Bundle[mParcelledData.dataSize=356]], android.support.customtabs.extra.TOOLBAR_COLOR=-15065823, android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS=true, androidx.browser.customtabs.extra.SHARE_STATE=0}]

iamolegga commented 1 year ago

could you try npm i react-native-launch-arguments@next and check if this bug is still here