itinance / itinance/react-native-fs

downloadFile crash with file:/// on release build (iOS)

Open
#798 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Updated to latest RN (0.61.2) & react-native-fs (2.16.1) and now seeing this. (iOS)

Only in release build. Debug works fine.

Using `image` as `fromUrl` in `downloadFile`
```
import { Image } from 'react-native'
const image = Image.resolveAssetSource(require('../assets/images/image01.jpg')).uri
```

debug - image = http://…
release - image = file:///...

So it doesn't work with file:///

```
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURLResponse statusCode]: unrecognized selector sent to instance

0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23bb9704 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23b9d7bc ___forwarding___ + 1436
4 CoreFoundation 0x00007fff23b9f6c8 _CF_forwarding_prep_0 + 120
5 0x0000000101e93d0a -[RNFSDownloader URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:] + 509
6 CFNetwork 0x00007fff22ea2b94 _CFNetworkHTTPConnectionCacheSetLimit + 204716
7 Foundation 0x00007fff25654583 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
8 Foundation 0x00007fff2565447b -[NSBlockOperation main] + 98
9 Foundation 0x00007fff25657408 __NSOPERATION_IS_INVOKING_MAIN__ + 17
10 Foundation 0x00007fff2565367b -[NSOperation start] + 731
11 Foundation 0x00007fff25657d62 __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 17
12 Foundation 0x00007fff2565786c __NSOQSchedule_f + 182
13 libdispatch.dylib 0x00000001026ca3ff _dispatch_block_async_invoke2 + 83
14 libdispatch.dylib 0x00000001026bbd64 _dispatch_client_callout + 8
15 libdispatch.dylib 0x00000001026be6d6 _dispatch_continuation_pop + 552
16 libdispatch.dylib 0x00000001026bdae1 _dispatch_async_redirect_invoke + 849
17 libdispatch.dylib 0x00000001026cd29a _dispatch_root_queue_drain + 351
18 libdispatch.dylib 0x00000001026cdba4 _dispatch_worker_thread2 + 132
19 libsystem_pthread.dylib 0x00007fff5141c6b3 _pthread_wqthread + 583
20 libsystem_pthread.dylib 0x00007fff5141c3fd start_wqthread + 13
```

This worked on RN (0.59.9) react-native-fs (2.13.3)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.