facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.75k stars 24.29k forks source link

Error React Native IOS Exception '-[__NSDictionaryM length]: unrecognised selector sent to #18589

Closed HusainKhanbahadur closed 6 years ago

HusainKhanbahadur commented 6 years ago

I have developed and build an app with React Native and the app working fine in Android but when i have made a build for IOS and installed on the iPhone Simulator then the app starts and then crashes suddenly and there is a stack of error.

I have reviewed the following https://github.com/bamlab/react-native-image-resizer/issues/21 https://github.com/facebook/react-native/issues/16808

Stack Trace

2018-03-27 17:11:26.335245+0530 VwWoocommerceAppMain[60359:812868] -[__NSDictionaryM length]: unrecognized selector sent to instance 0x6000002344e0 2018-03-27 17:11:26.385892+0530 VwWoocommerceAppMain[60359:812795] Task <6FE5A79E-00E0-48BA-9710-E84556451236>.<10> finished with error - code: -999 2018-03-27 17:11:26.388438+0530 VwWoocommerceAppMain[60359:812795] Task <4F05F51A-F709-486D-B762-A4E3A547EA3F>.<11> finished with error - code: -999 2018-03-27 17:11:26.390357+0530 VwWoocommerceAppMain[60359:812795] Task <7AA4447B-BDA8-4A52-BFB3-0159087A286F>.<7> finished with error - code: -999 2018-03-27 17:11:26.391486+0530 VwWoocommerceAppMain[60359:812795] Task <9C8840BB-9B93-4FB9-95C4-CE382231F2C8>.<4> finished with error - code: -999 2018-03-27 17:11:26.393324+0530 VwWoocommerceAppMain[60359:812795] Task <89101FB6-34BB-4E67-ACA5-3EE211834934>.<9> finished with error - code: -999 2018-03-27 17:11:26.393641+0530 VwWoocommerceAppMain[60359:812792] Task <89101FB6-34BB-4E67-ACA5-3EE211834934>.<9> HTTP load failed (error code: 12 [1:12]) 2018-03-27 17:11:26.395728+0530 VwWoocommerceAppMain[60359:812795] Task <23A4778D-80A5-44E1-8726-42E58B01C854>.<3> finished with error - code: -999 2018-03-27 17:11:26.397012+0530 VwWoocommerceAppMain[60359:812795] Task <BF3CAD70-6A20-45DA-9B0E-9054D887ED55>.<5> finished with error - code: -999 2018-03-27 17:11:26.372 [fatal][tid:com.facebook.react.AsyncLocalStorageQueue] Exception '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x6000002344e0' was thrown while invoking multiSet on target AsyncLocalStorage with params ( ( ( cart, { } ) ), 3317 ) callstack: ( 0 CoreFoundation 0x000000010e1ec12b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010caeaf41 objc_exception_throw + 48 2 CoreFoundation 0x000000010e26d024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x000000010e16ef78 ___forwarding___ + 1432 4 CoreFoundation 0x000000010e16e958 _CF_forwarding_prep_0 + 120 5 VwWoocommerceAppMain 0x000000010bb27824 -[RCTAsyncLocalStorage _writeEntry:changedManifest:] + 258 6 VwWoocommerceAppMain 0x000000010bb28104 -[RCTAsyncLocalStorage multiSet:callback:] + 436 7 CoreFoundation 0x000000010e17036c __invoking___ + 140 8 CoreFoundation 0x000000010e170240 -[NSInvocation invoke] + 320 9 CoreFoundation 0x000000010e188c26 -[NSInvocation invokeWithTarget:] + 54 10 VwWoocommerceAppMain 0x000000010bb37929 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602 11 VwWoocommerceAppMain 0x000000010bb7d7a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 266 12 VwWoocommerceAppMain 0x000000010bb7d522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78 13 libdispatch.dylib 0x0000000112e532f7 _dispatch_call_block_and_release + 12 14 libdispatch.dylib 0x0000000112e5433d _dispatch_client_callout + 8 15 libdispatch.dylib 0x0000000112e5c855 _dispatch_queue_serial_drain + 1162 16 libdispatch.dylib 0x0000000112e5d1ea _dispatch_queue_invoke + 336 17 libdispatch.dylib 0x0000000112e58f7c _dispatch_queue_override_invoke + 733 18 libdispatch.dylib 0x0000000112e60102 _dispatch_root_queue_drain + 772 19 libdispatch.dylib 0x0000000112e5fda0 _dispatch_worker_thread3 + 132 20 libsystem_pthread.dylib 0x000000011331b5a2 _pthread_wqthread + 1299 21 libsystem_pthread.dylib 0x000000011331b07d start_wqthread + 13 ) 2018-03-27 17:11:26.402781+0530 VwWoocommerceAppMain[60359:812868] Exception '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x6000002344e0' was thrown while invoking multiSet on target AsyncLocalStorage with params ( ( ( cart, { } ) ), 3317 ) callstack: ( 0 CoreFoundation 0x000000010e1ec12b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010caeaf41 objc_exception_throw + 48 2 CoreFoundation 0x000000010e26d024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x000000010e16ef78 ___forwarding___ + 1432 4 CoreFoundation 0x000000010e16e958 _CF_forwarding_prep_0 + 120 5 VwWoocommerceAppMain 0x000000010bb27824 -[RCTAsyncLocalStorage _writeEntry:changedManifest:] + 258 6 VwWoocommerceAppMain 0x000000010bb28104 -[RCTAsyncLocalStorage multiSet:callback:] + 436 7 CoreFoundation 0x000000010e17036c __invoking___ + 140 8 CoreFoundation 0x000000010e170240 -[NSInvocation invoke] + 320 9 CoreFoundation 0x000000010e188c26 -[NSInvocation invokeWithTarget:] + 54 10 VwWoocommerceAppMain 0x000000010bb37929 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602 11 VwWoocommerceAppMain 0x000000010bb7d7a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 266 12 VwWoocommerceAppMain 0x000000010bb7d522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78 13 libdispatch.dylib 0x0000000112e532f7 _dispatch_call_block_and_release + 12 14 libdispatch.dylib 0x0000000112e5433d _dispatch_client_callout + 8 15 libdispatch.dylib 0x0000000112e5c855 _dispatch_queue_serial_drain + 1162 16 libdispatch.dylib 0x0000000112e5d1ea _dispatch_queue_invoke + 336 17 libdispatch.dylib 0x0000000112e58f7c _dispatch_queue_override_invoke + 733 18 libdispatch.dylib 0x0000000112e60102 _dispatch_root_queue_drain + 772 19 libdispatch.dylib 0x0000000112e5fda0 _dispatch_worker_thread3 + 132 20 libsystem_pthread.dylib 0x000000011331b5a2 _pthread_wqthread + 1299 21 libsystem_pthread.dylib 0x000000011331b07d start_wqthread + 13 ) 2018-03-27 17:11:26.405942+0530 VwWoocommerceAppMain[60359:812868] *** Terminating app due to uncaught exception 'RCTFatalException: Exception '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x6000002344e0' was thrown while invoking multiSet on target AsyncLocalStorage with params ( ( ( cart, { } ) ), 3317 ) callstack: ( 0 CoreFoundation 0x000000010e1ec12b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010caeaf41 objc_exception_throw + 48 2 CoreFoundation 0x000000010e26d024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x000000010e16ef78 ___forwarding___ + 1432 4 CoreFoundation 0x000000010e16e958 _CF_forwarding_prep_0 + 120 5 VwWoocommerceAppMain 0x000000010bb27824 -[RCTAsyncLocalStorage _writeEntry:changedManifest:] + 258 6 VwWoocommerceAppMain 0x000000010bb28104 -[RCTAsyncLocalStorage multiSet:callback:] + 436 7 CoreFoundation 0x000000010e17036c __invoking___ + 140 8 CoreFoundation 0x000000010e170240 -[NSInvocation invoke] + 320 9 CoreFoundation 0x000000010e188c26 -[NSInvocation invokeWithTarget:] + 54 10 VwWoocommerceAppMain 0x000000010bb37929 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602 11 VwWoocommerceAppMain 0x000000010bb7d7a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 266 12 VwWoocommerceAppMain 0x000000010bb7d522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78 13 libdispatch.dylib 0x0000000112e532f7 _dispatch_call_block_and_release + 12 14 libdispatch.dylib 0x0000000112e5433d _dispatch_client_callout + 8 15 libdispatch.dylib 0x0000000112e5c855 _dispatch_queue_serial_drain + 1162 16 libdispatch.dylib 0x0000000112e5d1ea _dispatch_queue_invoke + 336 17 libdispatch.dylib 0x0000000112e58f7c _dispatch_queue_override_invoke + 733 18 libdispatch.dylib 0x0000000112e60102 _dispatch_root_queue_drain + 772 19 libdispatch.dylib 0x0000000112e5fda0 _dispatch_worker_thread3 + 132 20 libsystem_pthread.dylib 0x000000011331b5a2 _pthread_wqthread + 1299 21 libsystem_pthread.dylib 0x000000011331b07d start_wqthread + 13 )', reason: 'Exception '-[__NSDictionaryM length]: unrecognized selector sent to instanc...' *** First throw call stack: ( 0 CoreFoundation 0x000000010e1ec12b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010caeaf41 objc_exception_throw + 48 2 VwWoocommerceAppMain 0x000000010bb24a22 RCTFormatError + 0 3 VwWoocommerceAppMain 0x000000010bb7d9bc _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 798 4 VwWoocommerceAppMain 0x000000010bb7d522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78 5 libdispatch.dylib 0x0000000112e532f7 _dispatch_call_block_and_release + 12 6 libdispatch.dylib 0x0000000112e5433d _dispatch_client_callout + 8 7 libdispatch.dylib 0x0000000112e5c855 _dispatch_queue_serial_drain + 1162 8 libdispatch.dylib 0x0000000112e5d1ea _dispatch_queue_invoke + 336 9 libdispatch.dylib 0x0000000112e58f7c _dispatch_queue_override_invoke + 733 10 libdispatch.dylib 0x0000000112e60102 _dispatch_root_queue_drain + 772 11 libdispatch.dylib 0x0000000112e5fda0 _dispatch_worker_thread3 + 132 12 libsystem_pthread.dylib 0x000000011331b5a2 _pthread_wqthread + 1299 13 libsystem_pthread.dylib 0x000000011331b07d start_wqthread + 13 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Error libsystem_kernel.dylib`__pthread_kill: Thread 16: signal SIGABRT on -> 0x1132e6d42 <+10>: jae 0x1132e6d4c ; <+20>

Environment

"OS: macOS Sierra 10.12.6 Node: 8.10.0 Yarn: 1.5.1 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: Not Found

Packages: (wanted => installed) react: ^16.3.0-alpha.1 => 16.3.0-alpha.3 react-native: 0.54.2 => 0.54.2

I have used react-native link command before building the app and added all the dependencies.

I have searched a lot and couldn't find anything

If anyone knows please help.

react-native-bot commented 6 years ago

Thanks for posting this! It looks like your issue may be incomplete. Are all the fields required by the Issue Template filled out?

If you believe your issue contains all the relevant information, let us know in order to have a maintainer remove the No Template label. Thank you for your contributions.

How to ContributeWhat to Expect from Maintainers

react-native-bot commented 6 years ago

Thanks for posting this! It looks like your issue may be missing some necessary information. Can you run react-native info and edit your issue to include these results under the Environment section?

Thank you for your contributions.

react-native-bot commented 6 years ago

This issue looks like a question that would be best asked on Stack Overflow.

Stack Overflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

Will close this as this is really a question that should be asked on Stack Overflow.

HusainKhanbahadur commented 6 years ago

I have entered this on StackOverflow as well but haven't got reply till now

shashankwadi commented 6 years ago

please help resolving this

vrajeshkanna commented 6 years ago

I got a similar issue while storing a number. I converted that to a string before setting it to AsyncStorage as shown below, then it worked without flaws

 AsyncStorage.setItem('stars', value+'');