react-native-blob-util
react-native-blob-util copied to clipboard
react-native-blob-util v0.17.0 crashes
Our app crashes on RN 0.68.5 with react-native-blob-util v0.17.0 Our app is not written with new architecture so maybe it is the problem
When I downgrade to react-native-blob-util v0.16.4, it is working
What error do you get when your app crashes?
Here is XCode StackTrace when the app starts on simulator:
MyApp[12623:67414] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView bridge]: unrecognized selector sent to instance 0x7fe8c20103f0'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff20405604 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff201a4a45 objc_exception_throw + 48
2 CoreFoundation 0x00007fff204145ba +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 UIKitCore 0x00007fff250d62d5 -[UIResponder doesNotRecognizeSelector:] + 264
4 CoreFoundation 0x00007fff20409bbf ___forwarding___ + 1471
5 CoreFoundation 0x00007fff2040bd48 _CF_forwarding_prep_0 + 120
6 MyApp 0x0000000100d23b84 +[ReactNativeBlobUtil getRCTEventDispatcher] + 244
7 MyApp 0x0000000100d24044 __27-[ReactNativeBlobUtil init]_block_invoke + 36
8 libdispatch.dylib 0x000000010536a816 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x000000010536ba5b _dispatch_client_callout + 8
10 libdispatch.dylib 0x000000010537a325 _dispatch_main_queue_drain + 1169
11 libdispatch.dylib 0x0000000105379e86 _dispatch_main_queue_callback_4CF + 31
12 CoreFoundation 0x00007fff20371ed5 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
13 CoreFoundation 0x00007fff2036c6ca __CFRunLoopRun + 2761
14 CoreFoundation 0x00007fff2036b704 CFRunLoopRunSpecific + 562
15 GraphicsServices 0x00007fff2cba9c8e GSEventRunModal + 139
16 UIKitCore 0x00007fff2509e65a -[UIApplication _run] + 928
17 UIKitCore 0x00007fff250a32b5 UIApplicationMain + 101
18 MyApp 0x00000001007c85d8 main + 104
19 dyld 0x0000000103dacf21 start_sim + 10
20 ??? 0x000000010819a52e 0x0 + 4430865710
)
libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/myname/Library/Developer/Xcode/DerivedData/MyApp-atztyvegdfrmeegzdwwlarrlkdbw/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib DYLD_FRAMEWORK_PATH=/Users/myname/Library/Developer/Xcode/DerivedData/MyApp-atztyvegdfrmeegzdwwlarrlkdbw/Build/Products/Debug-iphonesimulator
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView bridge]: unrecognized selector sent to instance 0x7fe8c20103f0'
CoreSimulator 857.7 - Device: iPhone 12 (15687DDA-75EA-425B-981F-621C23ACFAE1) - Runtime: iOS 15.5 (19F70) - DeviceType: iPhone 12
IS the cras hhappening on start up or when you're calling a certain function?
If the later, please provide a code snippet so I can try to reproduce it
On start up
IS the cras hhappening on start up or when you're calling a certain function?
If the later, please provide a code snippet so I can try to reproduce it
It happens on startup
I can't reproduce the problem in a new project. You sure you run the pod install correctly and your podfile isn't problematic somewhere?
I can also see my app crashing after the 0.17.0 update. Had to revert back.
@jinshin1013 which react-native version? Android or iOS? Do you get the same error message? And if iOS, did you run a pod isntall?
@cortinico sorry to bother you, do you have any idea what might be going on here? I can't reproduce it on my devices with a new project...
In my case I get similar error on iOS
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(0x196893a84 0x194ce5958 0x196a21554 0x1968a3a54 0x1055b4bc8 0x1055b338c 0x107ccc08c 0x107ccd8c4 0x107cd00ac 0x107cdfaa4 0x107ce0414 0x1e303ab14 0x1e303a67c)
libc++abi: terminating with uncaught exception of type NSException
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
Something about
// generate boundary
__block NSString * boundary = [NSString stringWithFormat:@"ReactNativeBlobUtil%d", timeStampObj];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
This might be an issue of using the .fetch()
with empty array body since when I add a dummy file, it starts working again.
const requestFiles = []
ReactNativeBlobUtil.fetch("POST", WEB_BASE_API_URL, headers, requestFiles).uploadProgress((written, total) => {
onUploadProgress({
loaded: written,
total
})
})
Versions tested: 0.16.4, 0.17.0 RN: 0.69.7 xcode 14 ios 16.1
In my case I get similar error on iOS
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' *** First throw call stack: (0x196893a84 0x194ce5958 0x196a21554 0x1968a3a54 0x1055b4bc8 0x1055b338c 0x107ccc08c 0x107ccd8c4 0x107cd00ac 0x107cdfaa4 0x107ce0414 0x1e303ab14 0x1e303a67c) libc++abi: terminating with uncaught exception of type NSException terminating with uncaught exception of type NSException *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
Something about
// generate boundary __block NSString * boundary = [NSString stringWithFormat:@"ReactNativeBlobUtil%d", timeStampObj]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
This might be an issue of using the
.fetch()
with empty array body since when I add a dummy file, it starts working again.const requestFiles = [] ReactNativeBlobUtil.fetch("POST", WEB_BASE_API_URL, headers, requestFiles).uploadProgress((written, total) => { onUploadProgress({ loaded: written, total }) })
Versions tested: 0.16.4, 0.17.0 RN: 0.69.7 xcode 14 ios 16.1
Thank you - but I think this is another issue. In 0.16.4 it works, in 0.17.0 it doesn't? So like we lost the check on the length
I still can't reproduce your issue @keremoge. Any additional info on it?
In my case I get similar error on iOS
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' *** First throw call stack: (0x196893a84 0x194ce5958 0x196a21554 0x1968a3a54 0x1055b4bc8 0x1055b338c 0x107ccc08c 0x107ccd8c4 0x107cd00ac 0x107cdfaa4 0x107ce0414 0x1e303ab14 0x1e303a67c) libc++abi: terminating with uncaught exception of type NSException terminating with uncaught exception of type NSException *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
Something about
// generate boundary __block NSString * boundary = [NSString stringWithFormat:@"ReactNativeBlobUtil%d", timeStampObj]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
This might be an issue of using the
.fetch()
with empty array body since when I add a dummy file, it starts working again.const requestFiles = [] ReactNativeBlobUtil.fetch("POST", WEB_BASE_API_URL, headers, requestFiles).uploadProgress((written, total) => { onUploadProgress({ loaded: written, total }) })
Versions tested: 0.16.4, 0.17.0 RN: 0.69.7 xcode 14 ios 16.1
Thank you - but I think this is another issue. In 0.16.4 it works, in 0.17.0 it doesn't? So like we lost the check on the length
None of those two versions work, when passing empty array.
I still can't reproduce your issue @keremoge. Any additional info on it?
Here is detailed error info: Is it related to UIKit? (in main.m)
Thread 1 Queue : com.apple.main-thread (serial)
#0 0x00007fff7017300e in __pthread_kill ()
#1 0x00007fff701cb1ff in pthread_kill ()
#2 0x00007fff2010b6b7 in abort ()
#3 0x00007fff2025a5a2 in abort_message ()
#4 0x00007fff2024b73d in demangling_terminate_handler() ()
#5 0x00007fff20189d74 in _objc_terminate() ()
#6 0x00007fff202599c7 in std::__terminate(void (*)()) ()
#7 0x00007fff20259978 in std::terminate() ()
#8 0x00007fff201a4bc4 in objc_terminate ()
#9 0x0000000108eb6a6f in _dispatch_client_callout ()
#10 0x0000000108ec5325 in _dispatch_main_queue_drain ()
#11 0x0000000108ec4e86 in _dispatch_main_queue_callback_4CF ()
#12 0x00007fff20371ed5 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#13 0x00007fff2036c6ca in __CFRunLoopRun ()
#14 0x00007fff2036b704 in CFRunLoopRunSpecific ()
#15 0x00007fff2cba9c8e in GSEventRunModal ()
#16 0x00007fff2509e65a in -[UIApplication _run] ()
#17 0x00007fff250a32b5 in UIApplicationMain ()
#18 0x0000000104536dd8 in main at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/ios/AlbarakaApp/main.m:8
#19 0x0000000107b1ef21 in start_sim ()
#20 0x0000000108ce752e in start ()
Enqueued from com.apple.root.default-qos.overcommit (Thread 14) Queue : com.apple.root.default-qos.overcommit (serial)
#0 0x0000000108eba913 in dispatch_async ()
#1 0x0000000104a9214f in -[ReactNativeBlobUtil init] at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native-blob-util/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm:69
#2 0x000000010472f4d4 in __115-[RCTModuleData initWithModuleClass:bridge:moduleRegistry:viewRegistry_DEPRECATED:bundleManager:callableJSModules:]_block_invoke at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/Base/RCTModuleData.mm:115
#3 0x0000000104730171 in -[RCTModuleData setUpInstanceAndBridge:] at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/Base/RCTModuleData.mm:189
#4 0x0000000104733330 in -[RCTModuleData instance] at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/Base/RCTModuleData.mm:471
#5 0x00000001047338d9 in -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/Base/RCTModuleData.mm:515
#6 0x0000000104733d29 in -[RCTModuleData exportedConstants] at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/Base/RCTModuleData.mm:553
#7 0x0000000104740809 in facebook::react::RCTNativeModule::getConstants() at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/CxxModule/RCTNativeModule.mm:68
#8 0x00000001048e57f7 in facebook::react::ModuleRegistry::getConfig(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/ReactCommon/cxxreact/ModuleRegistry.cpp:156
#9 0x0000000104952475 in facebook::react::JSINativeModules::createModule(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp:82
#10 0x000000010495201c in facebook::react::JSINativeModules::getModule(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp:47
#11 0x000000010493e1ea in facebook::react::JSIExecutor::NativeModuleProxy::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp:45
#12 0x000000010491d2b7 in facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::getProperty(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/ReactCommon/jsi/JSCRuntime.cpp:723
#13 0x00007fff32daeb2a in JSC::JSCallbackObject<JSC::JSNonFinalObject>::getOwnPropertySlot(JSC::JSObject*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&) ()
#14 0x00007fff336b3ad5 in llint_slow_path_get_by_val ()
#15 0x00007fff32d17fbd in llint_entry ()
#16 0x00007fff32d298d0 in llint_entry ()
#17 0x00007fff32d29947 in llint_entry ()
#18 0x000024d1a62542cd in 0x24d1a62542cd ()
#19 0x00007fff32d29947 in llint_entry ()
#20 0x000024d1a62542cd in 0x24d1a62542cd ()
#21 0x00007fff32d29947 in llint_entry ()
#22 0x000024d1a62542cd in 0x24d1a62542cd ()
#23 0x00007fff32d29947 in llint_entry ()
#24 0x000024d1a62542cd in 0x24d1a62542cd ()
#25 0x00007fff32d29947 in llint_entry ()
#26 0x000024d1a62542cd in 0x24d1a62542cd ()
#27 0x00007fff32d29947 in llint_entry ()
#28 0x000024d1a62542cd in 0x24d1a62542cd ()
#29 0x00007fff32d29947 in llint_entry ()
#30 0x000024d1a62542cd in 0x24d1a62542cd ()
#31 0x000024d1a6250c63 in 0x24d1a6250c63 ()
#32 0x00007fff32d29ad2 in llint_entry ()
#33 0x00007fff32d0c646 in vmEntryToJavaScript ()
#34 0x00007fff3356623e in JSC::Interpreter::executeProgram(JSC::SourceCode const&, JSC::JSGlobalObject*, JSC::JSObject*) ()
#35 0x00007fff33879cf3 in JSC::evaluate(JSC::JSGlobalObject*, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&) ()
#36 0x00007fff32da9410 in JSEvaluateScript ()
#37 0x00000001049156c5 in facebook::jsc::JSCRuntime::evaluateJavaScript(std::__1::shared_ptr<facebook::jsi::Buffer const> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/ReactCommon/jsi/JSCRuntime.cpp:429
#38 0x000000010493671b in facebook::react::JSIExecutor::loadBundle(std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp:159
#39 0x00000001048fe2c1 in facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1::operator()(facebook::react::JSExecutor*) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp:146
#40 0x00000001048fe180 in decltype(static_cast<facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1&>(fp)(static_cast<facebook::react::JSExecutor*>(fp0))) std::__1::__invoke<facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1&, facebook::react::JSExecutor*>(facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1&, facebook::react::JSExecutor*&&) at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/type_traits:3918
#41 0x00000001048fe132 in void std::__1::__invoke_void_return_wrapper<void, true>::__call<facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1&, facebook::react::JSExecutor*>(facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1&, facebook::react::JSExecutor*&&) at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/invoke.h:61
#42 0x00000001048fe0f2 in std::__1::__function::__alloc_func<facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1, std::__1::allocator<facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:178
#43 0x00000001048fcbf1 in std::__1::__function::__func<facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1, std::__1::allocator<facebook::react::NativeToJsBridge::loadBundle(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)::$_1>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:352
#44 0x000000010490b5ca in std::__1::__function::__value_func<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) const at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:505
#45 0x000000010490b54d in std::__1::function<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*) const at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:1182
#46 0x000000010490b517 in facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8::operator()() const at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp:310
#47 0x000000010490b4a5 in decltype(static_cast<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&>(fp)()) std::__1::__invoke<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&>(facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&) at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/type_traits:3918
#48 0x000000010490b45d in void std::__1::__invoke_void_return_wrapper<void, true>::__call<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&>(facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8&) at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/invoke.h:61
#49 0x000000010490b42d in std::__1::__function::__alloc_func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8>, void ()>::operator()() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:178
#50 0x0000000104909fc9 in std::__1::__function::__func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8>, void ()>::operator()() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:352
#51 0x0000000104985c72 in std::__1::__function::__value_func<void ()>::operator()() const at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:505
#52 0x0000000104985ba5 in std::__1::function<void ()>::operator()() const at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:1182
#53 0x00000001046f3955 in facebook::react::tryAndReturnError(std::__1::function<void ()> const&) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/CxxModule/RCTCxxUtils.mm:74
#54 0x0000000104722ad1 in facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/CxxBridge/RCTMessageThread.mm:69
#55 0x0000000104727d63 in facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1::operator()() const at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/CxxBridge/RCTMessageThread.mm:82
#56 0x0000000104727cf5 in decltype(static_cast<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(fp)()) std::__1::__invoke<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&) at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/type_traits:3918
#57 0x0000000104727cad in void std::__1::__invoke_void_return_wrapper<void, true>::__call<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&) at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/invoke.h:61
#58 0x0000000104727c7d in std::__1::__function::__alloc_func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1>, void ()>::operator()() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:178
#59 0x0000000104726919 in std::__1::__function::__func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1>, void ()>::operator()() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:352
#60 0x0000000104985c72 in std::__1::__function::__value_func<void ()>::operator()() const at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:505
#61 0x0000000104985ba5 in std::__1::function<void ()>::operator()() const at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/c++/v1/__functional/function.h:1182
#62 0x000000010472283a in invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/CxxBridge/RCTMessageThread.mm:45
#63 0x00007fff2037223d in __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ ()
#64 0x00007fff2037163b in __CFRunLoopDoBlocks ()
#65 0x00007fff2036c628 in __CFRunLoopRun ()
#66 0x00007fff2036b704 in CFRunLoopRunSpecific ()
#67 0x00000001046c4595 in +[RCTCxxBridge runRunLoop] at /Users/abdullahkeremoge/Coding/MobileClient/mobile-branch/node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:378
#68 0x00007fff208511a1 in __NSThread__start__ ()
#69 0x00007fff701cb4e1 in _pthread_start ()
#70 0x00007fff701c6f6b in thread_start ()
can confirm, happens on iPhone 14Pro simulator and device, but weirdly not on iPhone14 simulator (no device at hand)
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView bridge]: unrecognized selector sent to instance 0x139825dd0'
*** First throw call stack:
(
0 CoreFoundation 0x000000018040e7ec __exceptionPreprocess + 172
1 libobjc.A.dylib 0x0000000180051144 objc_exception_throw + 56
2 CoreFoundation 0x000000018041d49c +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 UIKitCore 0x000000010f9e5fd8 -[UIResponder doesNotRecognizeSelector:] + 232
4 CoreFoundation 0x00000001804126ec ___forwarding___ + 1308
5 CoreFoundation 0x0000000180414b6c _CF_forwarding_prep_0 + 92
6 app-dev 0x0000000100d7efb4 +[ReactNativeBlobUtil getRCTEventDispatcher] + 184
7 app-dev 0x0000000100d7f41c __27-[ReactNativeBlobUtil init]_block_invoke + 36
8 libdispatch.dylib <…>
Same thing, downgrading to 0.16.4 works
my env :
xcode 14 "react": "17.0.2", "react-native": "0.67.5",
@cortinico sorry to bother you, do you have any idea what might be going on here? I can't reproduce it on my devices with a new project...
Same also can't reproduce. @romanonthego are you able to reproduce in any form? Also is the issue happening only on iOS or also on Android?
This error is happening to us intermittently in production, but I also can't reproduce it locally.
From investigating the stacktrace I have determined that the error is being thrown from this line:
https://github.com/RonRadtke/react-native-blob-util/blob/977a5a908116ae8afa8b7d59efae4ffde81aaa56/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm#L47
I suspect that what's happening is that the view returned by
https://github.com/RonRadtke/react-native-blob-util/blob/977a5a908116ae8afa8b7d59efae4ffde81aaa56/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm#L43
is somehow not actually of type RCTRootView
, which then causes the call to .bridge
to fail. However I have no idea why it would (only sometimes) be a different type.
I'm also having problems running 0.17.0 on react-native 0.70.6 using the new architecture. I'm building on an android platform and the app is crashing on start. The log error I get is different though:
[16:51:33] E | ReactNativeJS ▶︎ Error: Exception in HostFunction: java.lang.IllegalStateException: Native Module Flow doesn't declare constants: [LegacyMusicDir, LegacyRingtoneDir, LegacyPictureDir, LegacyMovieDir, LegacySDCardDir, LegacyDownloadDir, LegacyDCIMDir], js engine: hermes
[16:51:33] F | ReactNative ▶︎ /Users/redacted/Desktop/Git_Repo/janus/node_modules/react-native/ReactCommon/react/renderer/uimanager/bindingUtils.cpp:29: function getModule: assertion failed (moduleAsValue.isObject())
Versions tested: 0.17.0 RN: 0.70.6 Android 9 NewArchiteture = true
I did try it on an emulator running Android 11 and it worked.
Same here, I just upgraded to 0.17.1 and the app crashed when I tried to read a file from FS
Crash report
NSInvalidArgumentException: -[__NSArrayM bytes]: unrecognized selector sent to instance 0x282b7cb10
Offending line
const workoutFile = await ReactNativeBlobUtil.fs.readFile(filePath, 'ascii')
Hello, I find this crash only in crashlytics, but it started after updating the version to 0.17.0. It affects like 2% of my ios users. The error name is: ReactNativeBlobUtil.mm line 47 +[ReactNativeBlobUtil getRCTEventDispatcher]
Same here project was upgraded from RN 0.60.5
xCode 12.5.1
"react": "17.0.2",
"react-native": "0.67.4",
"react-native-navigation": "^7.26.0",
"react-native-blob-util": "^0.17.1"
Any solutions?
Same here, I am using 0.17.2
I am not sure how to reproduce this issue, but there is around 1% of our users are facing it immediately after startup
same hare, using after upgraded to "react-native": "0.71.3","react-native-blob-util": "^0.17.0",
@herarya @WadhahEssam @MCervenka @simon-abbott are you all using react-native-navigation? I managed to reproduce it using react-native-navigation....
@herarya @WadhahEssam @MCervenka @simon-abbott are you all using react-native-navigation? I managed to reproduce it using react-native-navigation....
I use react-native-navigation
We use @react-navigation/native
(together with @react-navigation/stack
), not react-native-navigation
.
v0.17.0, v0.17.2 still crash in iphone 14 pro model
I managed to reproduce it now and created a repo for testing: https://github.com/RonRadtke/RNBlob_bug_rootview
The issue seems to be that some libraries are exchanging the rootview with an own UIView and therefor I can't access the bridge via it anymore. But I don't have a solution for it yet. If anyone has a good idea, I would be very happy about some help.
Okay I think I should rework the whole EventEmitter logic to fix this so we are independant on the bridge and remove deprecated APIs in addition I put it on the todo for the next bigger update https://github.com/RonRadtke/react-native-blob-util/issues/226