Mediaplugin: crash app on ipad When you take a picture and then take another picture in xamarin forms

Created on 26 May 2019  路  17Comments  路  Source: jamesmontemagno/MediaPlugin

crash app with without error message on ipad When you take a picture and then take another picture in xamarin forms

Most helpful comment

@jamesmontemagno No error message or crash log but it freezes and then stops

All 17 comments

Would need a repro or crash log. I have taken hundreds of photos back to back.

I have seen the exact same issue on iPad, the app freezes / crashes on iOS version 12.3.1 running on iPad ONLY (it works on 12.3.1 on an iPhone).

Looking at the iOS logs it suggests a timeout where the camera is not launched a certain time.

It is worth pointing out it does not happen every time though, if you need any more info please let me know

What happens is when it tries to launch the camera the camera does not appear so the app is left in the foreground, when you try to interact with the app like pressing software back button or any other control nothing happens as it is frozen so you have to kill it

@jamesmontemagno No error message or crash log but it freezes and then stops

I just got the same exact same bug report and I can duplicate it. I can take as many photos as I want on an IPhone (tried 5S, 6S and XS) but when I take two photos on an iPad (2018) or on an iPad Pro (2018) the call to TakePhotoAsync does not return (when I take the second picture) and after 2 or 3 minutes the app crashes. I have AppCenter configured but I don't get any exception report for this crash. When I debug using VS2019 I also don't get an exception, the app just unloads after that period of time.

@jamesmontemagno would you try this on an iPad 2018 running the latest iOS and let us know if it worked for you?

I got a device log for both the iPhone and the iPad and the latter has these erros:

default 11:14:19.954574 +0100 IrisHH.iOS Call active status: Inactive (initial query)
default 11:14:19.962109 +0100 IrisHH.iOS Capture orientation LandscapeLeft (initial)
default 11:14:19.965604 +0100 IrisHH.iOS Photo/BackAuto (requestID=0): Calling -[AVCaptureSession beginConfiguration]
default 11:14:19.967101 +0100 IrisHH.iOS Paused iris video capture
default 11:14:19.967920 +0100 IrisHH.iOS Photo/BackAuto (requestID=0): Calling -[AVCaptureSession commitConfiguration]
default 11:14:19.968538 +0100 IrisHH.iOS Photo/BackAuto (requestID=0): Finished -[AVCaptureSession commitConfiguration] (took 0.000 seconds)
default 11:14:19.968641 +0100 IrisHH.iOS CAMCaptureEngine start (id=3: "initial configuration"): Session is not running. Calling -[AVCaptureSession startRunning].
error 11:14:19.974277 +0100 IrisHH.iOS CGContextAddPath: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
error 11:14:19.974377 +0100 IrisHH.iOS clip: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
error 11:14:19.974481 +0100 IrisHH.iOS CGContextSetFillColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
error 11:14:19.974581 +0100 IrisHH.iOS CGContextFillRects: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
error 11:14:19.974681 +0100 IrisHH.iOS CGContextAddPath: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
error 11:14:19.974788 +0100 IrisHH.iOS clip: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
error 11:14:19.974879 +0100 IrisHH.iOS CGContextDrawLinearGradient: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
...
error 11:16:45.344025 +0100 assertiond [IrisHH.iOS:2061] SyscallError: setpriority(PRIO_DARWIN_ROLE, 2061, 3): No such process

I cannot find a way to attach the full logs to this post but I can send them to you if it helps.

Just got a message from a customer that picking an image twice also crashes the app. I cannot duplicate it on the iPad Pro but the user has an iPad. This is a pity as I am left without a workaround.

Yes the problem still exists. Is there a solution?

I am stuck, I looked for an alternative way to take/pick pictures in Xamarin iOS but everyone refers to this plugin.

Yes I'm also facing same issue iOS 12.4.3 app crash.. but no error message

Did anyone find a solution to this?

@jamesmontemagno For repo, I noticed it happened on an iPhone 6 plus and it seems to happen more frequently if you attempt to zoom while taking the 2nd picture.

Info:
iPhone 6 plus
Software Version 12.4.3
Using the most recent beta version as of this post.

We have someone else here in the office with a more recent iPhone who CANNOT reproduce this, so it might be specific to a software version or iPhone version. Let me know if you need anything more to help, but I don't have a whole lot to go on. I just call TakePhotoAsync with save to album set to false and photo size medium.

Repo:

  1. Press button that triggers to take photo method
  2. Zoom in to 50%.
  3. Take and Save photo
  4. Press button that triggers to take photo method
  5. Zoom in to 50%
  6. Notice the app has frozen/hung and becomes non-responsive.

I also noticed it doesn't really occur after a reboot of the device. Overall it's extremely inconsistent but we do have users in the field reporting it.

After thinking about it more, is it possible this is related to using a slider like #450 @musab-alrmmah @josesimas Do either of you use sliders in your app? Do you use anything like GrailKit?

@Alex6511 no, no sliders at all in my app.

But I do use Grailkit @Alex6511 !

@josesimas I think this is being caused by Grailkit overriding the appearance of the zoom slider, but I have no idea how to fix it.

@josesimas Possible solution, check this out https://github.com/UXDivers/Grial-UI-Kit-Support/issues/333

@Alex6511 many thanks, I will have a go as soon as possible.

Doing the above solution resolved this issue for me. @musab-alrmmah if you use grailkit try the solution in the github above.

Was this page helpful?
0 / 5 - 0 ratings