cordova 插件应使用后台线程(由于未捕获异常“NSInvalidArgumentException”而终止应用程序)

insrf1ej  于 2022-11-15  发布在  其他
关注(0)|答案(1)|浏览(167)

i am trying to use cordova keychain [plugin][1] for ios, inside my ionic application. but facing this error
6:48 PM2020-07-14 18:44:32.456726+0500 Farsh[1817:53270] THREAD WARNING: ['Keychain'] took '14.635986' ms. Plugin should use a background thread. 2020-07-14 18:44:32.456767+0500 Farsh[1817:55957] -[NSNull boolValue]: unrecognized selector sent to instance 0x7fff8062d9d0 2020-07-14 18:44:32.614153+0500 Farsh[1817:55957] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull boolValue]: unrecognized selector sent to instance 0x7fff8062d9d0' *** First throw call stack: ( 0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48 2 CoreFoundation 0x00007fff23e5dc34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x00007fff23e4190c forwarding + 1436 4 CoreFoundation 0x00007fff23e43bf8 _CF_forwarding_prep_0 + 120 5 Farsh 0x000000010e66aac0 __19-[CDVKeychain set:]_block_invoke + 432 6 libdispatch.dylib 0x000000010e9c7f11 _dispatch_call_block_and_release

  • 12 7 libdispatch.dylib 0x000000010e9c8e8e _dispatch_client_callout + 8 8 libdispatch.dylib 0x000000010e9cb2d8 _dispatch_queue_override_invoke + 1022 9 libdispatch.dylib 0x000000010e9da399 _dispatch_root_queue_drain + 351 10 libdispatch.dylib 0x000000010e9daca6 _dispatch_worker_thread2 + 135 11 libsystem_pthread.dylib 0x00007fff51c089f7 _pthread_wqthread + 220 12 libsystem_pthread.dylib 0x00007fff51c07b77 start_wqthread + 15 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

and my application crashed after this. Is there anyone know how to solve this problem ?? Please answer Thanks in advance. [1]: https://ionicframework.com/docs/native/keychain

7lrncoxx

7lrncoxx1#

溶液

我也遇到了同样的问题,问题是我没有明确设置useTouchId参数的值。这个bug是known自2018年以来一直没有修复。向你展示了离子作为一个生态系统有多好,人们有多关心。更糟糕的😤是,即使是official docs(!)也有一个不正确的例子:
错误

this.keychain.set(key, value).then(() => { ... }

正确

this.keychain.set(key, value, false).then(() => { ... }

添加第三个参数应该可以解决您的问题。

相关问题