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

Failed to use cordova-plugin-camera-preview #1732

Closed
arielhernandezmusa opened this issue Jul 3, 2019 · 14 comments
Closed

Failed to use cordova-plugin-camera-preview #1732

arielhernandezmusa opened this issue Jul 3, 2019 · 14 comments

Comments

@arielhernandezmusa
Copy link
Contributor

arielhernandezmusa commented Jul 3, 2019

When tried to used cordova-plugin-camera-preview I get this error

o Native Cordova ->
CameraPreview
startCamera
CameraPreview756259444
["options": [0, 0, 414, 736, front, 1, 0, 0, 1, 0, 0, 0]]
2019-07-03 16:53:06.683542-0300 App[9796:1932987] Metal GPU Frame Capture Enabled
2019-07-03 16:53:06.684129-0300 App[9796:1932987] Metal API Validation Enabled
2019-07-03 16:53:06.750515-0300 App[9796:1932987] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<CameraRenderController: 0x145e1d450> should have parent view controller:(null) but actual parent is:<Capacitor.CAPBridgeViewController: 0x145d0fd30>'

I used it without Ionic, I build a mobile app with React JS and Capacitor

@bryplano
Copy link
Contributor

bryplano commented Jul 3, 2019

@arielhernandezmusa - do you have a sample repo / app that exhibits the error?

@arielhernandezmusa
Copy link
Contributor Author

@bryplano , I just pushed my example to this repo

https://github.com/arielhernandezmusa/react-capacitor.git

@arielhernandezmusa
Copy link
Contributor Author

In android simulator works fine

@arielhernandezmusa
Copy link
Contributor Author

@Bktechmasala thanks, but what I need is sometime like this:

IMG_4067

where I can add an overlay to camera

@ionic-team ionic-team deleted a comment Jul 8, 2019
@jcesarmobile
Copy link
Member

the problem is the plugin tries to add the camera view on the webview's superview, but in Capacitor the view structure is slightly different from Cordova and the webview is already the top view, there is no superview, so the plugin won't work on iOS

Closing as incompatible

@MichalKliment
Copy link

Hello @jcesarmobile ,
is there any alternative (in the future) how to use camera layer in own component in both platforms, please, or this option will be no longer able to use?

@arielhernandezmusa
Copy link
Contributor Author

@arielhernandezmusa
Copy link
Contributor Author

arielhernandezmusa commented Aug 17, 2019

That plugin is based on cordova-camera-preview, but updated to use capacitor’s webview

@craigster1991
Copy link

craigster1991 commented Jun 23, 2020

Hello, I'm having this issue with Ionic 5, despite it being listed as "compatible" on the Ionic documentation...
https://ionicframework.com/docs/native/camera-preview

Is there a known fix / something that should be done that's no in the Ionic documentation?

I'm using Ionic with Angular + capacitor.
Android works fine, but ios 13.4 exhibits the same error.

@GreenRidingHood
Copy link

GreenRidingHood commented Jul 9, 2020

@craigster1991 did you find solution, i am trying to use my @ionic/react capacitor ios app , cordova-plugin-camera-preview, but crushing at xcode..
Screen Shot 2020-07-08 at 11 41 51 AM

*this patch helped me
#3177

@craigster1991
Copy link

@craigster1991 did you find solution, i am trying to use my @ionic/react capacitor ios app , cordova-plugin-camera-preview, but crushing at xcode..
Screen Shot 2020-07-08 at 11 41 51 AM

*this patch helped me
#3177

@GreenRidingHood To be honest, I was in a time-locked situation and so had to resort to the standard camera plugin, which utilises the native viewfinder, shutter button etc.

@mateoc10
Copy link

@GreenRidingHood Same thing happens to me. I can't figure out how to make it work

@bravoivang
Copy link

The preview camera plugin is running in other webview. There is no way to render html over the preview.
There will be a fix for this?

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants