JeetuChoudhary opened a new issue #704: URL: https://github.com/apache/cordova-plugin-camera/issues/704
We have an ionic 3 application that uses a camera and gallery to select images. I am showing an action sheet and the user can select either gallery or camera to select an image. ## Error Selecting the camera disappears the status bar and make the application lagging. It throws the following stacktrace; ``` Main Thread Checker: UI API called on a background thread: -[UIImagePickerController init] PID: 3140, TID: 1450459, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0 Backtrace: 4 ManyTutors 0x00000001027a87a4 +[CDVCameraPicker createFromPictureOptions:] + 112 5 ManyTutors 0x00000001027a2d1c __25-[CDVCamera takePicture:]_block_invoke + 1148 6 libdispatch.dylib 0x00000001030c3bcc _dispatch_call_block_and_release + 32 7 libdispatch.dylib 0x00000001030c56c0 _dispatch_client_callout + 20 8 libdispatch.dylib 0x00000001030c80ec _dispatch_queue_override_invoke + 952 9 libdispatch.dylib 0x00000001030d8ae0 _dispatch_root_queue_drain + 364 10 libdispatch.dylib 0x00000001030d9488 _dispatch_worker_thread2 + 140 11 libsystem_pthread.dylib 0x00000001f6dbb7c8 _pthread_wqthread + 216 12 libsystem_pthread.dylib 0x00000001f6dc275c start_wqthread + 8 2021-01-11 17:13:01.703428+0800 ManyTutors[3140:1450459] [reports] Main Thread Checker: UI API called on a background thread: -[UIImagePickerController init] PID: 3140, TID: 1450459, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0 Backtrace: 4 ManyTutors 0x00000001027a87a4 +[CDVCameraPicker createFromPictureOptions:] + 112 5 ManyTutors 0x00000001027a2d1c __25-[CDVCamera takePicture:]_block_invoke + 1148 6 libdispatch.dylib 0x00000001030c3bcc _dispatch_call_block_and_release + 32 7 libdispatch.dylib 0x00000001030c56c0 _dispatch_client_callout + 20 8 libdispatch.dylib 0x00000001030c80ec _dispatch_queue_override_invoke + 952 9 libdispatch.dylib 0x00000001030d8ae0 _dispatch_root_queue_drain + 364 10 libdispatch.dylib 0x00000001030d9488 _dispatch_worker_thread2 + 140 11 libsystem_pthread.dylib 0x00000001f6dbb7c8 _pthread_wqthread + 216 12 libsystem_pthread.dylib 0x00000001f6dc275c start_wqthread + 8 [Camera] Failed to read exposureBiasesByMode dictionary: Error Domain=NSCocoaErrorDomain Code=4864 "* -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: data is NULL" UserInfo={NSDebugDescription=* -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: data is NULL} ``` ### What is expected to happen? When I select a camera for the first time, it should ask permission right away, and after giving the permission it should take a photo and use that photo in the app.  ## What does actually happen? When I click on the camera for the first time, It takes more than 2 minutes to show the permission dialog and after clicking the picture when we come back to the app, the app header disappears and the app starts lagging and doesn't work properly.  ### Environment, Platform, Device I only face this issue in IOS apps. Android works fine. For IOS, I have tested it on an emulator, on a real device in debugging mode, and also by uploading it to test flight. ### Version information ``` cli packages: (C:\nvm\v10.15.1\node_modules) @ionic/cli-utils : 1.19.2 ionic (Ionic CLI) : 3.20.0 global packages: cordova (Cordova CLI) : not installed local packages: @ionic/app-scripts : 3.2.4 Cordova Platforms : android 7.0.0 ios 5.0.1 Ionic Framework : ionic-angular 3.9.10 System: Android SDK Tools : 26.1.1 Node : v10.15.1 npm : 6.4.1 OS : Windows 10 Versions: Xcode Version : 12 IOS Version : 14 ``` Any Suggestion will be appreciated. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org