服务因 SIGABRT、线程 30 而退出

Service exited due to SIGABRT, Thread 30

我正在为我的 React Native 项目使用 react-native-background-downloader。有一个按钮,当我点击它时,下载开始于 Documents.dir(RNFetchBlob)。这是 Android OS 中的行为。但是在iOS,我一点击下载按钮。应用程序崩溃。 我认为这与 url 计划有关。我将 url 更改为硬编码的 url,就像 Play 商店 apk 一样,它起作用了。但是我曾经(想要)传递的url(哪个索引url)结果使我的应用程序崩溃

##完整日志:-

SLink_ios[11757:276497] Invalid URL scheme for background downloads: (null). Valid schemes are http or https 
2019-01-29 00:48:35.940985+0530 SLink_ios[11757:276497] Task <81F6DEDF-F785-48FA-979C-5C21382B3D14>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=( "BackgroundDownloadTask <81F6DEDF-F785-48FA-979C-5C21382B3D14>.<1>" ), NSLocalizedDescription=unsupported URL, _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundDownloadTask <81F6DEDF-F785-48FA-979C-5C21382B3D14>.<1>} [-1002] 
2019-01-29 00:48:35.943 [info][tid:main][RCTImageView.m:422] Reloading image http://localhost:8081/assets/src/Assets/download.png?platform=ios&hash=9dde24daa36aede3432b0ac881695f75 as size {36, 36} 
2019-01-29 00:48:35.942703+0530 SLink_ios[11757:276357] Reloading image http://localhost:8081/assets/src/Assets/download.png?platform=ios&hash=9dde24daa36aede3432b0ac881695f75 as size {36, 36} 
2019-01-29 00:48:35.943100+0530 SLink_ios[11757:276473] Task .<368> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=http://localhost:8081/assets/src/Assets/spinner.gif?platform=ios&hash=2f2ad9512c7ad4ea794d3a5d6adbd69e, NSErrorFailingURLKey=http://localhost:8081/assets/src/Assets/spinner.gif?platform=ios&hash=2f2ad9512c7ad4ea794d3a5d6adbd69e, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask .<368>" ), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<368>, NSLocalizedDescription=cancelled} [-999] 
2019-01-29 00:48:35.943343+0530 SLink_ios[11757:276432] Task .<368> finished with error - code: -999 
2019-01-29 00:48:35.954 [info][tid:com.facebook.react.JavaScript] unsupported URL 
2019-01-29 00:48:35.954103+0530 SLink_ios[11757:276480] unsupported URL 
2019-01-29 00:48:35.980064+0530 SLink_ios[11757:276357] To get test ads on this device, set: request.testDevices = @[ kGADSimulatorID ]; 
2019-01-29 00:48:35.999636+0530 SLink_ios[11757:276497] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSDictionaryM removeObjectForKey:]: key cannot be nil' *** First throw call stack: ( 0 CoreFoundation 0x000000010e93b1bb __exceptionPreprocess + 331 1 libobjc.A.dylib 0x000000010dd34735 objc_exception_throw + 48 2 CoreFoundation 0x000000010e8874ec _CFThrowFormattedException + 194 3 CoreFoundation 0x000000010e9acd45 -[__NSDictionaryM removeObjectForKey:] + 213 4 SLink_ios 0x0000000107f1cffc -[RNBackgroundDownloader removeTaskFromMap:] + 268 5 SLink_ios 0x0000000107f1ffdc -[RNBackgroundDownloader URLSession:task:didCompleteWithError:] + 572 6 CFNetwork 0x0000000109952342 __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.241 + 284 7 Foundation 0x000000010ae07f9e __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 7 8 Foundation 0x000000010ae07ea5 -[NSBlockOperation main] + 68 9 Foundation 0x000000010ae04c14 -[__NSOperationInternal _start:] + 689 10 Foundation 0x000000010ae0ac4b __NSOQSchedule_f + 227 11 libdispatch.dylib 0x000000010fa41595 _dispatch_call_block_and_release + 12 12 libdispatch.dylib 0x000000010fa42602 _dispatch_client_callout + 8 13 libdispatch.dylib 0x000000010fa4554d _dispatch_continuation_pop + 565 14 libdispatch.dylib 0x000000010fa44927 _dispatch_async_redirect_invoke + 859 15 libdispatch.dylib 0x000000010fa5300a _dispatch_root_queue_drain + 351 16 libdispatch.dylib 0x000000010fa539af _dispatch_worker_thread2 + 130 17 libsystem_pthread.dylib 0x000000010fe266dd _pthread_wqthread + 619 18 libsystem_pthread.dylib 0x000000010fe26405 start_wqthread + 13 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) `

我不知道 files/screenshots 需要回答这个问题。我正在上传我认为足够的那些。如果需要任何其他信息,我很乐意提供。

以下是所需的文件:- here

我尝试了以下操作:

  1. 已清理并重建项目。

  2. 已删除模拟器的所有内容和设置。

编码 url 对我有用:) encodeURI(url)