regulaforensics / DocumentReader-iOS

iOS Framework for reading and validation of identification documents
58 stars 15 forks source link

SDK crashing in ios 12.0, iPhone Xs Max #13

Closed jeethukthomas closed 5 years ago

jeethukthomas commented 5 years ago

Error: runtime: UI API called from background thread: -[UIApplication applicationState] must be used from main thread only

It happened immediately when the scanner detects the document. in iOS 11 and all, its working fine

DzmitrySmaliakou commented 5 years ago

Error: runtime: UI API called from background thread: -[UIApplication applicationState] must be used from main thread only

This is knows issue, it will be fixed in the next release version, but it shouldn't trigger a crash.

Could you please provide more information about this issue? How we can reproduce it on our side?

jeethukthomas commented 5 years ago

But in iOS12 its triggering crash

DzmitrySmaliakou commented 5 years ago

We have tested on few different devices with iOS 12 and all working fine, can you provide full crash log, please?

jeethukthomas commented 5 years ago

Im using, Xcode 10, swift 4.+ with iPhone Xs Max running on iOS 12. Im getting the following error after scanning the document, before receiving the control in the "handleResult(result: DocumentReaderResults?)" delegate.

================================================================= Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState] PID: 670, TID: 37290, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0 Backtrace: 4 libobjc.A.dylib 0x000000019cb17894 + 56 5 CoreMotion 0x00000001a33787a4 CoreMotion + 305060 6 CoreMotion 0x00000001a3378cd8 CoreMotion + 306392 7 CoreMotion 0x00000001a3378be8 CoreMotion + 306152 8 CoreMotion 0x00000001a33aa3cc CoreMotion + 508876 9 CoreMotion 0x00000001a33aa42c CoreMotion + 508972 10 CoreFoundation 0x000000019d8b0888 + 28 11 CoreFoundation 0x000000019d8b016c + 276 12 CoreFoundation 0x000000019d8ab470 + 2324 13 CoreFoundation 0x000000019d8aa844 CFRunLoopRunSpecific + 452 14 CoreFoundation 0x000000019d8ab5a8 CFRunLoopRun + 84 15 CoreMotion 0x00000001a33a9d64 CoreMotion + 507236 16 libsystem_pthread.dylib 0x000000019d525a04 + 132 17 libsystem_pthread.dylib 0x000000019d525960 _pthread_start + 52 18 libsystem_pthread.dylib 0x000000019d52ddf4 thread_start + 4 2018-10-24 13:29:03.441354+0530 PassportAuthenticator[670:37290] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState] PID: 670, TID: 37290, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0 Backtrace: 4 libobjc.A.dylib 0x000000019cb17894 + 56 5 CoreMotion 0x00000001a33787a4 CoreMotion + 305060 6 CoreMotion 0x00000001a3378cd8 CoreMotion + 306392 7 CoreMotion 0x00000001a3378be8 CoreMotion + 306152 8 CoreMotion 0x00000001a33aa3cc CoreMotion + 508876 9 CoreMotion 0x00000001a33aa42c CoreMotion + 508972 10 CoreFoundation 0x000000019d8b0888 + 28 11 CoreFoundation 0x000000019d8b016c + 276 12 CoreFoundation 0x000000019d8ab470 + 2324 13 CoreFoundation 0x000000019d8aa844 CFRunLoopRunSpecific + 452 14 CoreFoundation 0x000000019d8ab5a8 CFRunLoopRun + 84 15 CoreMotion 0x00000001a33a9d64 CoreMotion + 507236 16 libsystem_pthread.dylib 0x000000019d525a04 + 132 17 libsystem_pthread.dylib 0x000000019d525960 _pthread_start + 52 18 libsystem_pthread.dylib 0x000000019d52ddf4 thread_start + 4 Scaning not finished. Result: <DocumentReaderResults: 0x2808650e0> Scaning not finished. Result: <DocumentReaderResults: 0x28084d900> Scaning not finished. Result: <DocumentReaderResults: 0x28084d770> Scaning not finished. Result: <DocumentReaderResults: 0x28084dc70> Scaning not finished. Result: <DocumentReaderResults: 0x28084d040> Scaning not finished. Result: <DocumentReaderResults: 0x28084d3b0> Scaning not finished. Result: <DocumentReaderResults: 0x2808657c0> Scaning not finished. Result: <DocumentReaderResults: 0x280865bd0> Scaning not finished. Result: <DocumentReaderResults: 0x2808660d0> Scaning not finished. Result: <DocumentReaderResults: 0x280864e60> Scaning not finished. Result: <DocumentReaderResults: 0x280864d20> Scaning not finished. Result: <DocumentReaderResults: 0x280865400> Scaning not finished. Result: <DocumentReaderResults: 0x280866120> Scaning not finished. Result: <DocumentReaderResults: 0x280864e60> Scaning not finished. Result: <DocumentReaderResults: 0x28084e030> Scaning not finished. Result: <DocumentReaderResults: 0x28084d9f0> Scaning not finished. Result: <DocumentReaderResults: 0x280864d20> Scaning not finished. Result: <DocumentReaderResults: 0x28084cdc0> Scaning not finished. Result: <DocumentReaderResults: 0x28084c690> Scaning not finished. Result: <DocumentReaderResults: 0x28084e030> Scaning not finished. Result: <DocumentReaderResults: 0x2808665d0> Scaning not finished. Result: <DocumentReaderResults: 0x280866080> Scaning not finished. Result: <DocumentReaderResults: 0x280866030> Scaning not finished. Result: <DocumentReaderResults: 0x280865360> Scaning not finished. Result: <DocumentReaderResults: 0x280864eb0> Scaning not finished. Result: <DocumentReaderResults: 0x2808d5cc0> libc++abi.dylib: terminating with uncaught exception of type (anonymous namespace)::ExifParsingError (lldb)

jeethukthomas commented 5 years ago

While using this git example code also im getting the same error.

DzmitrySmaliakou commented 5 years ago

Thank you for your report, we have able to reproduce it in our side, now.

As we understand it crashed only on new devices like Xs and Xs Max. It is a problem in our Core part and unrelated with calling UI API from background thread.

We are working on to resolve this issue shortly.

jeethukthomas commented 5 years ago

We are working on a PoC app, and the device we use for the demo is iPhone Xs Max with iOS 12. We want to complete this by today. So, will you able to give a fix for this issue by today at the earliest? Else, we have to look for alternatives.

DzmitrySmaliakou commented 5 years ago

@jeethukthomas Unfortunately, we can't resolve this issue very fast. We are still working on it now. After fix we should prepare new release version for API and Core, so it will take some time

DzmitrySmaliakou commented 5 years ago

@jeethukthomas Hello, we have fixed this issue, and preparing new release version right now. If you want to get it faster please email to our support: support@regulaforensics.com

jeethukthomas commented 5 years ago

Thank you. I have already mailed you. Please do the needful

DzmitrySmaliakou commented 5 years ago

Fixed in latest release