gpt4 book ai didi

ios - 错误 React Native IOS 异常 '-[__NSDictionaryM 长度] : unrecognised selector sent to

转载 作者:行者123 更新时间:2023-12-01 17:46:54 28 4
gpt4 key购买 nike

我是 IOS 开发的新手,我已经在 React Native 中开发并构建了一个适用于 IOS 和 Android 的应用程序,该应用程序在 Android 中完全可用。我还在 iPhone 模拟器上安装了该应用程序进行测试,在成功构建后,当应用程序打开时它崩溃了,Xcode 显示了错误堆栈。

堆栈跟踪

2018-03-26 17:18:59.537548+0530 VwWoocommerceAppMain[57934:681649] -[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000023abc0
2018-03-26 17:18:59.555 [fatal][tid:com.facebook.react.AsyncLocalStorageQueue] Exception '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000023abc0' was thrown while invoking multiSet on target AsyncLocalStorage with params (
(
(
cart,
{
}
)
),
5873
)
callstack: (
0 CoreFoundation 0x0000000103f8212b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000102874f41 objc_exception_throw + 48
2 CoreFoundation 0x0000000104003024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000103f04f78 ___forwarding___ + 1432
4 CoreFoundation 0x0000000103f04958 _CF_forwarding_prep_0 + 120
5 VwWoocommerceAppMain 0x0000000101956824 -[RCTAsyncLocalStorage _writeEntry:changedManifest:] + 258
6 VwWoocommerceAppMain 0x0000000101957104 -[RCTAsyncLocalStorage multiSet:callback:] + 436
7 CoreFoundation 0x0000000103f0636c __invoking___ + 140
8 CoreFoundation 0x0000000103f06240 -[NSInvocation invoke] + 320
9 CoreFoundation 0x0000000103f1ec26 -[NSInvocation invokeWithTarget:] + 54
10 VwWoocommerceAppMain 0x0000000101966929 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602
11 VwWoocommerceAppMain 0x00000001019ac7a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 266
12 VwWoocommerceAppMain 0x00000001019ac522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
13 libdispatch.dylib 0x0000000108bf32f7 _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x0000000108bf433d _dispatch_client_callout + 8
15 libdispatch.dylib 0x0000000108bfc855 _dispatch_queue_serial_drain + 1162
16 libdispatch.dylib 0x0000000108bfd1ea _dispatch_queue_invoke + 336
17 libdispatch.dylib 0x0000000108bf8f7c _dispatch_queue_override_invoke + 733
18 libdispatch.dylib 0x0000000108c00102 _dispatch_root_queue_drain + 772
19 libdispatch.dylib 0x0000000108bffda0 _dispatch_worker_thread3 + 132
20 libsystem_pthread.dylib 0x00000001091465a2 _pthread_wqthread + 1299
21 libsystem_pthread.dylib 0x000000010914607d start_wqthread + 13
)
2018-03-26 17:18:59.558030+0530 VwWoocommerceAppMain[57934:681649] Exception '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000023abc0' was thrown while invoking multiSet on target AsyncLocalStorage with params (
(
(
cart,
{
}
)
),
5873
)
callstack: (
0 CoreFoundation 0x0000000103f8212b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000102874f41 objc_exception_throw + 48
2 CoreFoundation 0x0000000104003024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000103f04f78 ___forwarding___ + 1432
4 CoreFoundation 0x0000000103f04958 _CF_forwarding_prep_0 + 120
5 VwWoocommerceAppMain 0x0000000101956824 -[RCTAsyncLocalStorage _writeEntry:changedManifest:] + 258
6 VwWoocommerceAppMain 0x0000000101957104 -[RCTAsyncLocalStorage multiSet:callback:] + 436
7 CoreFoundation 0x0000000103f0636c __invoking___ + 140
8 CoreFoundation 0x0000000103f06240 -[NSInvocation invoke] + 320
9 CoreFoundation 0x0000000103f1ec26 -[NSInvocation invokeWithTarget:] + 54
10 VwWoocommerceAppMain 0x0000000101966929 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602
11 VwWoocommerceAppMain 0x00000001019ac7a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 266
12 VwWoocommerceAppMain 0x00000001019ac522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
13 libdispatch.dylib 0x0000000108bf32f7 _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x0000000108bf433d _dispatch_client_callout + 8
15 libdispatch.dylib 0x0000000108bfc855 _dispatch_queue_serial_drain + 1162
16 libdispatch.dylib 0x0000000108bfd1ea _dispatch_queue_invoke + 336
17 libdispatch.dylib 0x0000000108bf8f7c _dispatch_queue_override_invoke + 733
18 libdispatch.dylib 0x0000000108c00102 _dispatch_root_queue_drain + 772
19 libdispatch.dylib 0x0000000108bffda0 _dispatch_worker_thread3 + 132
20 libsystem_pthread.dylib 0x00000001091465a2 _pthread_wqthread + 1299
21 libsystem_pthread.dylib 0x000000010914607d start_wqthread + 13
)
2018-03-26 17:18:59.561965+0530 VwWoocommerceAppMain[57934:681649] *** Terminating app due to uncaught exception 'RCTFatalException: Exception '-[__NSDictionaryM length]: unrecognized selector sent to instance 0x60000023abc0' was thrown while invoking multiSet on target AsyncLocalStorage with params (
(
(
cart,
{
}
)
),
5873
)
callstack: (
0 CoreFoundation 0x0000000103f8212b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000102874f41 objc_exception_throw + 48
2 CoreFoundation 0x0000000104003024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000103f04f78 ___forwarding___ + 1432
4 CoreFoundation 0x0000000103f04958 _CF_forwarding_prep_0 + 120
5 VwWoocommerceAppMain 0x0000000101956824 -[RCTAsyncLocalStorage _writeEntry:changedManifest:] + 258
6 VwWoocommerceAppMain 0x0000000101957104 -[RCTAsyncLocalStorage multiSet:callback:] + 436
7 CoreFoundation 0x0000000103f0636c __invoking___ + 140
8 CoreFoundation 0x0000000103f06240 -[NSInvocation invoke] + 320
9 CoreFoundation 0x0000000103f1ec26 -[NSInvocation invokeWithTarget:] + 54
10 VwWoocommerceAppMain 0x0000000101966929 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602
11 VwWoocommerceAppMain 0x00000001019ac7a8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 266
12 VwWoocommerceAppMain 0x00000001019ac522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
13 libdispatch.dylib 0x0000000108bf32f7 _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x0000000108bf433d _dispatch_client_callout + 8
15 libdispatch.dylib 0x0000000108bfc855 _dispatch_queue_serial_drain + 1162
16 libdispatch.dylib 0x0000000108bfd1ea _dispatch_queue_invoke + 336
17 libdispatch.dylib 0x0000000108bf8f7c _dispatch_queue_override_invoke + 733
18 libdispatch.dylib 0x0000000108c00102 _dispatch_root_queue_drain + 772
19 libdispatch.dylib 0x0000000108bffda0 _dispatch_worker_thread3 + 132
20 libsystem_pthread.dylib 0x00000001091465a2 _pthread_wqthread + 1299
21 libsystem_pthread.dylib 0x000000010914607d start_wqthread + 13
)', reason: 'Exception '-[__NSDictionaryM length]: unrecognized selector sent to instanc...'
*** First throw call stack:
(
0 CoreFoundation 0x0000000103f8212b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000102874f41 objc_exception_throw + 48
2 VwWoocommerceAppMain 0x0000000101953a22 RCTFormatError + 0
3 VwWoocommerceAppMain 0x00000001019ac9bc _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 798
4 VwWoocommerceAppMain 0x00000001019ac522 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
5 libdispatch.dylib 0x0000000108bf32f7 _dispatch_call_block_and_release + 12
6 libdispatch.dylib 0x0000000108bf433d _dispatch_client_callout + 8
7 libdispatch.dylib 0x0000000108bfc855 _dispatch_queue_serial_drain + 1162
8 libdispatch.dylib 0x0000000108bfd1ea _dispatch_queue_invoke + 336
9 libdispatch.dylib 0x0000000108bf8f7c _dispatch_queue_override_invoke + 733
10 libdispatch.dylib 0x0000000108c00102 _dispatch_root_queue_drain + 772
11 libdispatch.dylib 0x0000000108bffda0 _dispatch_worker_thread3 + 132
12 libsystem_pthread.dylib 0x00000001091465a2 _pthread_wqthread + 1299
13 libsystem_pthread.dylib 0x000000010914607d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

有知道的请帮忙

最佳答案

AsyncStorage 中保存数据时,无论您的数据是什么,始终使用 JSON.stringify:

AsyncStorage.setItem('@key', 'will work on Android'))
AsyncStorage.setItem('@key', JSON.stringify('will work on both iOS and Android'))

关于ios - 错误 React Native IOS 异常 '-[__NSDictionaryM 长度] : unrecognised selector sent to,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49491485/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com