question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hey guys.

We’ve rn-fetch-blob working on iOS 12 however on iOS 13, it causes our app to freeze. Here is a sample code

RNFetchBlob.config(configOptions)
       .fetch('GET', fileUrl)
       .then(async resp => {
         filePath = resp.path();
         let options = {
           type: type,
           url: filePath 
         };
         this.setState({loading: false});
         await Share.open(options);

         await RNFS.unlink(filePath);
       });

Has anyone experienced this?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:11

github_iconTop GitHub Comments

2reactions
samithafcommented, Nov 28, 2020

I had to add, IOSBackgroundTask to be true to solve this problem. Here is the complete function and config.

const { dirs } = RNFetchBlob.fs;
const dirToSave = Platform.select({
    ios: dirs.DocumentDir,
    android: dirs.DownloadDir
  });
const res = await RNFetchBlob.config({
      IOSBackgroundTask: true,
      fileCache: true,
      indicator: true,
      path
    }).fetch('GET', url);
if (Platform.OS === 'ios') {
   RNFetchBlob.ios.previewDocument(path);
} else {
 await RNFetchBlob.android.actionViewIntent(path, mime);
}
0reactions
samithafcommented, Nov 18, 2020

Same problem and getting following errors in native layer.

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 4366, TID: 1417030, Thread name: (none), Queue name: RNFetchBlob.queue, QoS: 0
Backtrace:
4   rn_fetch_blob                       0x000000010a4c9564 -[RNFetchBlob previewDocument:scheme:resolver:rejecter:] + 328
5   CoreFoundation                      0x0000000195d52130 96F8386D-D88A-3C89-A323-A17975C3317F + 1175856
6   CoreFoundation                      0x0000000195c351c0 96F8386D-D88A-3C89-A323-A17975C3317F + 8640
7   CoreFoundation                      0x0000000195c35720 96F8386D-D88A-3C89-A323-A17975C3317F + 10016
8   React                               0x0000000108fcdd78 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1880
9   React                               0x0000000108fd1478 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 648
10  React                               0x0000000108fd102c _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 128
11  React                               0x0000000108fd0fa0 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
12  libdispatch.dylib                   0x000000010a61bce4 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010a61d528 _dispatch_client_callout + 16
14  libdispatch.dylib                   0x000000010a6245ac _dispatch_lane_serial_drain + 748
15  libdispatch.dylib                   0x000000010a625234 _dispatch_lane_invoke + 452
16  libdispatch.dylib                   0x000000010a630a5c _dispatch_workloop_worker_thread + 1456
17  libsystem_pthread.dylib             0x00000001dc35a5a4 _pthread_wqthread + 272
18  libsystem_pthread.dylib             0x00000001dc35d874 start_wqthread + 8
2020-11-18 15:39:03.580951+1100 Acme-Lite[4366:1417030] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 4366, TID: 1417030, Thread name: (none), Queue name: RNFetchBlob.queue, QoS: 0
Backtrace:
4   rn_fetch_blob                       0x000000010a4c9564 -[RNFetchBlob previewDocument:scheme:resolver:rejecter:] + 328
5   CoreFoundation                      0x0000000195d52130 96F8386D-D88A-3C89-A323-A17975C3317F + 1175856
6   CoreFoundation                      0x0000000195c351c0 96F8386D-D88A-3C89-A323-A17975C3317F + 8640
7   CoreFoundation                      0x0000000195c35720 96F8386D-D88A-3C89-A323-A17975C3317F + 10016
8   React                               0x0000000108fcdd78 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1880
9   React                               0x0000000108fd1478 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 648
10  React                               0x0000000108fd102c _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 128
11  React                               0x0000000108fd0fa0 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
12  libdispatch.dylib                   0x000000010a61bce4 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010a61d528 _dispatch_client_callout + 16
14  libdispatch.dylib                   0x000000010a6245ac _dispatch_lane_serial_drain + 748
15  libdispatch.dylib                   0x000000010a625234 _dispatch_lane_invoke + 452
16  libdispatch.dylib                   0x000000010a630a5c _dispatch_workloop_worker_thread + 1456
17  libsystem_pthread.dylib             0x00000001dc35a5a4 _pthread_wqthread + 272
18  libsystem_pthread.dylib             0x00000001dc35d874 start_wqthread + 8
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIWindow rootViewController]
PID: 4366, TID: 1417030, Thread name: (none), Queue name: RNFetchBlob.queue, QoS: 0
Backtrace:
4   rn_fetch_blob                       0x000000010a4c959c -[RNFetchBlob previewDocument:scheme:resolver:rejecter:] + 384
5   CoreFoundation                      0x0000000195d52130 96F8386D-D88A-3C89-A323-A17975C3317F + 1175856
6   CoreFoundation                      0x0000000195c351c0 96F8386D-D88A-3C89-A323-A17975C3317F + 8640
7   CoreFoundation                      0x0000000195c35720 96F8386D-D88A-3C89-A323-A17975C3317F + 10016
8   React                               0x0000000108fcdd78 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1880
9   React                               0x0000000108fd1478 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 648
10  React                               0x0000000108fd102c _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 128
11  React                               0x0000000108fd0fa0 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
12  libdispatch.dylib                   0x000000010a61bce4 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010a61d528 _dispatch_client_callout + 16
14  libdispatch.dylib                   0x000000010a6245ac _dispatch_lane_serial_drain + 748
15  libdispatch.dylib                   0x000000010a625234 _dispatch_lane_invoke + 452
16  libdispatch.dylib                   0x000000010a630a5c _dispatch_workloop_worker_thread + 1456
17  libsystem_pthread.dylib             0x00000001dc35a5a4 _pthread_wqthread + 272
18  libsystem_pthread.dylib             0x00000001dc35d874 start_wqthread + 8
2020-11-18 15:39:14.015336+1100 Acme-Lite[4366:1417030] [reports] Main Thread Checker: UI API called on a background thread: -[UIWindow rootViewController]
PID: 4366, TID: 1417030, Thread name: (none), Queue name: RNFetchBlob.queue, QoS: 0
Backtrace:
4   rn_fetch_blob                       0x000000010a4c959c -[RNFetchBlob previewDocument:scheme:resolver:rejecter:] + 384
5   CoreFoundation                      0x0000000195d52130 96F8386D-D88A-3C89-A323-A17975C3317F + 1175856
6   CoreFoundation                      0x0000000195c351c0 96F8386D-D88A-3C89-A323-A17975C3317F + 8640
7   CoreFoundation                      0x0000000195c35720 96F8386D-D88A-3C89-A323-A17975C3317F + 10016
8   React                               0x0000000108fcdd78 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1880
9   React                               0x0000000108fd1478 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 648
10  React                               0x0000000108fd102c _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 128
11  React                               0x0000000108fd0fa0 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
12  libdispatch.dylib                   0x000000010a61bce4 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010a61d528 _dispatch_client_callout + 16
14  libdispatch.dylib                   0x000000010a6245ac _dispatch_lane_serial_drain + 748
15  libdispatch.dylib                   0x000000010a625234 _dispatch_lane_invoke + 452
16  libdispatch.dylib                   0x000000010a630a5c _dispatch_workloop_worker_thread + 1456
17  libsystem_pthread.dylib             0x00000001dc35a5a4 _pthread_wqthread + 272
18  libsystem_pthread.dylib             0x00000001dc35d874 start_wqthread + 8
Read more comments on GitHub >

github_iconTop Results From Across the Web

App crashes at start under iOS 13.… | Apple Developer Forums
I develop an app that works fine under iOS 14.x (any subversion). It's a classic storyboard/swift app. It is supposed to be compatible...
Read more >
Fix Apple iPhone with apps that keep crashing after iOS 13
Troubleshooting Apple iPhone with apps that keep crashing after iOS 13 · First solution: Clear all background apps. · Second solution: Restart ...
Read more >
iPhone 13 Apps Keep Crashing? Here's The Fix! - Dr.Fone
Part I: How to Stop Apps from Crashing on iPhone 13 · Solution 1: Restart iPhone 13 · Solution 2: Close Other Apps...
Read more >
Big Problem for iPhone 13 Users iOS 16.1 App crashes ...
This Video is related to iOS 16.1 issuesTime Stamps0:00 Big Problem for iPhone users0:28 iPhone 13 green screen issue1:40 iOS 16.1.1 ?2:02 ...
Read more >
Why does Graphical Analysis GW crash on iOS 13? (fixed)
On November 26, 2019, Vernier Software & Technology released an updated version (4.0.6) of Graphical GW to resolve issues related to iOS 13....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found