Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS13 - Select Video / getPicture #546

Closed
3 tasks done
NeckbreakerPascal opened this issue Jan 13, 2020 · 4 comments
Closed
3 tasks done

iOS13 - Select Video / getPicture #546

NeckbreakerPascal opened this issue Jan 13, 2020 · 4 comments

Comments

@NeckbreakerPascal
Copy link

NeckbreakerPascal commented Jan 13, 2020

Bug Report

Problem

on iOS 13 I am not longer able to select a video on device. SourceType is PHOTOLIBRARY

What is expected to happen?

The Plugin takes a pictures from the lib and returns it.

What does actually happen?

  • the getPicture-Function return the error: No Image Selected

Information

It could be a problem in the "/cordova-plugin-camera/src/ios/CDVCamera.m".

Additional Log from XCode:

Main Thread Checker: UI API called on a background thread: -[UINavigationController setDelegate:]
PID: 452, TID: 46187, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4 0x00000001023803e0 -[CDVCamera showCameraPicker:withOptions:] + 192
5 0x000000010237fa04 __25-[CDVCamera takePicture:]_block_invoke + 1052
6 libdispatch.dylib 0x00000001029957fc _dispatch_call_block_and_release + 24
7 libdispatch.dylib 0x0000000102996bd8 _dispatch_client_callout + 16
8 libdispatch.dylib 0x00000001029992d2020-01-13 14:30:00.245796+0100[452:45994] [Process] kill() returned unexpected error 1
4 _dispatch_queue_override_invoke + 872
9 libdispatch.dylib 0x00000001029a8160 _dispatch_root_queue_drain + 376
10 libdispatch.dylib 0x00000001029a8a88 _dispatch_worker_thread2 + 156
11 libsystem_pthread.dylib 0x00000001bba3eb48 _pthread_wqthread + 212
12 libsystem_pthread.dylib 0x00000001bba41760 start_wqthread + 8
2020-01-13 14:30:00.245894+0100[452:46187] [reports] Main Thread Checker: UI API called on a background thread: -[UINavigationController setDelegate:]
PID: 452, TID: 46187, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4 0x00000001023803e0 -[CDVCamera showCameraPicker:withOptions:] + 192
5 0x000000010237fa04 __25-[CDVCamera takePicture:]_block_invoke + 1052
6 libdispatch.dylib 0x000000010299572020-01-13 14:30:00.245931+0100[452:45994] [Process] kill() returned unexpected error 1
2020-01-13 14:30:00.246164+0100[452:45994] [Process] kill() returned unexpected error 1
2020-01-13 14:30:00.246250+0100[452:45994] [Process] kill() returned unexpected error 1
2020-01-13 14:30:00.246537+0100[452:45994] [Process] kill() returned unexpected error 1
2020-01-13 14:30:00.247224+0100[452:45994] [Process] kill() returned unexpected error 1
fc _dispatch_call_block_and_release + 24
7 libdispatch.dylib 0x0000000102996bd8 _dispatch_client_callout + 16
8 libdispatch.dylib 0x00000001029992d4 _dispatch_queue_override_invoke + 872
9 libdispatch.dylib 0x00000001029a8160 _dispatch_root_queue_drain + 376
10 libdispatch.dylib 0x00000001029a8a88 _dispatch_worker_thread2 + 156
11 libsystem_pthread.dylib 0x00000001bba3eb48 _pthread_wqthread + 212
12 libsystem_pthread.dylib 2020-01-13 14:30:00.247495+0100

Command or Code

Found this in the "CVDCamera.m", but it is in the block where imagePickerControllerDidCancel but I did not cancel. So not totally sure if that is the right place to look for this problem.

    dispatch_block_t invoke = ^ (void) {
        CDVPluginResult* result;
        if (picker.sourceType == UIImagePickerControllerSourceTypeCamera && [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] != ALAuthorizationStatusAuthorized) {
            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to camera"];
        } else if (picker.sourceType != UIImagePickerControllerSourceTypeCamera && ! IsAtLeastiOSVersion(@"11.0") && [ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusAuthorized) {
            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to assets"];
        } else {
            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No Image Selected"];
        }

Environment, Platform, Device

iPhone 7, iOS 13.3

Version information

Ionic:

Ionic CLI : 5.4.13 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.8

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 17 other plugins)

Utility:

cordova-res : 0.6.0 (update available: 0.8.1)
native-run : 0.2.8 (update available: 0.3.0)

System:

ios-deploy : 1.9.2
ios-sim : 8.0.2
NodeJS : v8.11.3 (/usr/local/bin/node)
npm : 5.6.0
OS : macOS Mojave
Xcode : Xcode 11.3 Build version 11C29

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@Burnie777
Copy link

I am also getting this issue on the PictureSourceType.CAMERA...

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIImagePickerController init]
PID: 568, TID: 171674, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4 STssSmartMeter 0x000000010028d334 +[CDVCameraPicker createFromPictureOptions:] + 112
5 STssSmartMeter 0x000000010028753c -[CDVCamera showCameraPicker:withOptions:] + 108
6 STssSmartMeter 0x0000000100286d58 __25-[CDVCamera takePicture:]_block_invoke_2 + 336
7 TCC 0x000000019ff8ab60 B49C034E-858E-3F03-BA88-BB8BD0A811C1 + 7008
8 TCC 0x000000019ff8eb28 B49C034E-858E-3F03-BA88-BB8BD0A811C1 + 23336
9 libxpc.dylib 0x0000000199962c84 D263F3EB-967C-33B9-AF70-D48644FA8411 + 97412
10 libxpc.dylib 0x0000000199956f18 D263F3EB-967C-33B9-AF70-D48644FA8411 + 48920
11 libdispatch.dylib 0x000000010088ec58 _dispatch_client_callout3 + 16
12 libdispatch.dylib 0x00000001008aa29c _dispatch_mach_msg_async_reply_invoke + 388
13 libdispatch.dylib 0x00000001008a103c _dispatch_kevent_worker_thread + 1376
14 libsystem_pthread.dylib 0x0000000199aa6bc0 _pthread_wqthread + 332
15 libsystem_pthread.dylib 0x0000000199aa9760 start_wqthread + 8
2020-01-14 09:21:30.451972+0200 STssSmartMeter[568:171674] [reports] Main Thread Checker: UI API called on a background thread: -[UIImagePickerController init]
PID: 568, TID: 171674, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4 STssSmartMeter 0x000000010028d334 +[CDVCameraPicker createFromPictureOptions:] + 112
5 STssSmartMeter 0x000000010028753c -[CDVCamera showCameraPicker:withOptions:] + 108
6 STssSmartMeter 0x0000000100286d58 __25-[CDVCamera takePicture:]_block_invoke_2 + 336
7 TCC 0x000000019ff8ab60 B49C034E-858E-3F03-BA88-BB8BD0A811C1 + 7008
8 TCC 0x000000019ff8eb28 B49C034E-858E-3F03-BA88-BB8BD0A811C1 + 23336
9 libxpc.dylib 0x0000000199962c84 D263F3EB-967C-33B9-AF70-D48644FA8411 + 97412
10 libxpc.dylib 0x0000000199956f18 D263F3EB-967C-33B9-AF70-D48644FA8411 + 48920
11 libdispatch.dylib 0x000000010088ec58 _dispatch_client_callout3 + 16
12 libdispatch.dylib 0x00000001008aa29c _dispatch_mach_msg_async_reply_invoke + 388
13 libdispatch.dylib 0x00000001008a103c _dispatch_kevent_worker_thread + 1376
14 libsystem_pthread.dylib 0x0000000199aa6bc0 _pthread_wqthread + 332
15 libsystem_pthread.dylib 0x0000000199aa9760 start_wqthread + 8

It eventually opens the Camera, but it takes a while sometimes up to 3 minutes for the camera too open...

@NeckbreakerPascal
Copy link
Author

NeckbreakerPascal commented Jan 16, 2020

There is a solution for both! The slow and the problem with the Select Video.

First, select Video can be fixed with this one here:
#506

and the slow Camera thing is caused by the UI Main THread checker. This one helps:
https://stackoverflow.com/questions/58038810/xcode-10-main-thread-checker-cordova-camera-plugin

Tried both with iOS 13.3.

@albertleao
Copy link

There is a solution for both! The slow and the problem with the Select Video.

First, select Video can be fixed with this one here:
#546

and the slow Camera thing is caused by the UI Main THread checker. This one helps:
https://stackoverflow.com/questions/58038810/xcode-10-main-thread-checker-cordova-camera-plugin

Tried both with iOS 13.3.

The link you (#546) referenced is to this page, did you mean to paste something else?

@NeckbreakerPascal
Copy link
Author

There is a solution for both! The slow and the problem with the Select Video.
First, select Video can be fixed with this one here:
#546
and the slow Camera thing is caused by the UI Main THread checker. This one helps:
https://stackoverflow.com/questions/58038810/xcode-10-main-thread-checker-cordova-camera-plugin
Tried both with iOS 13.3.

The link you (#546) referenced is to this page, did you mean to paste something else?

Sorry! Yes! It is this one here:
#506

I edited my answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants