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

bug: Camera Plugin Crashes on iOS with processAssertionWasInvalidated #2897

Closed
1 of 4 tasks
seanharr11 opened this issue May 9, 2020 · 5 comments
Closed
1 of 4 tasks

Comments

@seanharr11
Copy link

seanharr11 commented May 9, 2020

Bug Report

Capacitor Version

npx cap doctor output:
💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 2.1.0

@capacitor/core: 2.1.0

@capacitor/android: 2.1.0

@capacitor/electron: 2.1.0

@capacitor/ios: 2.1.0

Installed Dependencies:

@capacitor/android not installed

@capacitor/electron not installed

@capacitor/cli 2.1.0

@capacitor/ios 2.1.0

@capacitor/core 2.1.0

Found 0 Capacitor plugins for ios:
[success] iOS looking great! 👌

Affected Platform(s)

  • Android
  • iOS
  • Electron
  • Web

Current Behavior

Take a picture using the Camera plugin via getPhoto(), tap "Use Photo", app crashes intermittently (oftentimes within 3 attempts of taking the photo). XCode console logs include:

2020-05-09 18:12:03.311351-0400 App[35271:9064095] [ProcessSuspension] 0x10b0d4300 - ProcessAssertion::processAssertionWasInvalidated()
2020-05-09 18:12:03.311491-0400 App[35271:9064095] [ProcessSuspension] 0x10b0d42d0 - ProcessAssertion::processAssertionWasInvalidated()
2020-05-09 18:12:03.312651-0400 App[35271:9064095] [assertion] Error acquiring assertion: <NSError: 0x28321ebb0; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">
2020-05-09 18:12:03.313488-0400 App[35271:9064095] [assertion] Error acquiring assertion: <NSError: 0x28326ff90; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">

Expected Behavior

The photo should be captured successfully

Sample Code or Sample Application Repo

https://github.com/seanharr11/capacitor-camera-crash

Reproduction Steps

  1. Take a picture
  2. Tap "Use Photo"
  3. After 1-5 tries, expect a quick "whitescreen + reload". In example app, Tab2 swipes back in if the app is able to recover.

Other Technical Details

npm --version output: 6.9.0

node --version output: v12.3.1

pod --version output (iOS issues only): 1.8.4

Other Information

This seems to be more reproducible on older phones, namely our iPhone 7+ test device. It has been occurring in our production mobile app across many different version of iPhones.

@seanharr11
Copy link
Author

Update: Confirmed this problem also exists on pre-2.0 versions of Capacitor.

@priyankpat
Copy link
Contributor

I just tested the repo on my test iPhone 6 (12.4.6) and have no issue with the picture capture.

@jcesarmobile
Copy link
Member

This is a known issue on the native component used by the Camera plugin (UIImagePickerController), it sometimes fails to release the memory if a lot of pictures are taken sequently and ends up restarting the app, in addition in some iOS versions the WebView didn't handle the memory well can caused even more frequent restarts.
The WebView issue was fixed a few versions back, not sure about the Camera component, but sadly there is nothing we can do about it, keep reporting it on Apples radar and maybe they fix it if they haven't done already.

@abarax
Copy link

abarax commented Sep 24, 2021

Is there the possibility of using a difference component to UIImagePickerController?

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 10, 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 10, 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

4 participants