-
Notifications
You must be signed in to change notification settings - Fork 154
Description
I've been trying to get to the bottom of this issue. I've seen it over on the old repo and there's not been a good solution for it.
On certain devices...namely Realme, Oppo and Huawei a regular crash seems to be occurring. I've tested using a "Realme 7" phone, Android 11 and can reproduce it every time w/ the below scenario.
The issue seems to be triggered if you re-download a previously downloaded item again and you have addAndroidDownloads: path
set.
Upon completing the 2nd download onReceive
seems to fire twice.
The following line is called:
react-native-blob-util/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilReq.java
Line 804 in e73e279
this.callback.invoke(null, ReactNativeBlobUtilConst.RNFB_RESPONSE_PATH, customDest); |
At this point in time this.callback.mInvoked
is true which fires an exception taking you to line 808 which attempts to fire another callback and causes the crash:
react-native-blob-util/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilReq.java
Line 808 in e73e279
this.callback.invoke(ex.getLocalizedMessage(), null); |
I can get this issue to stop happening if I change the path
supplied to be unique so I'm wondering if this is something to do with this value or maybe the source file Url?
I'd love to figure out exactly why this is happening! Has anyone else seen this?