Open muffadal53 opened 4 years ago
Same situation
https://devblogs.microsoft.com/xamarin/new-ios-10-privacy-permission-settings/ I found this solution
https://devblogs.microsoft.com/xamarin/new-ios-10-privacy-permission-settings/ I found this solution
@truekxmexico :My issue is not relate to permissions. I have provided permission dialog before picking any photo using this plugin. The problem occurs when we any alert dialog is clicked and then we go to Mediaplugin the above exception is thrown.
Thanks.
@jamesmontemagno : Any update when this issue will be fixed?
Faced the same issue after granting permission for microphone, before navigate to camera on iOS 13.
Faced the same issue here...
I am facing this issue, any updates on this?
Can you reproduce it with the latest version of xamarin.forms? In which situation does it crash, can you create a simple project to demonstrate the issue?
@muffadal53 Any solution?
Also seeing this after user displays an rg popup.
Edit: turns out it's not after an RG popup, but rather after a Page alert or action sheet.
we sometimes get this crash reported when users pick images or take photos - but have no context to the crashes :/
I have now reproduced this in the following sequence of events user is shown an rg popup popup is dismissed and an alert is displayed. user dismisses the popup, navigates onto another page. On that page, taps a button to pick a photo. app crashes.
using: Version Number of Plugin: 5.0.1 Device Tested On: IOS Version of VS: VS 2019 Version of Xamarin: 4.8.0.1534 Version of Popup plugin: 2.0.0.6
https://devblogs.microsoft.com/xamarin/new-ios-10-privacy-permission-settings/ I found this solution
@truekxmexico :My issue is not relate to permissions. I have provided permission dialog before picking any photo using this plugin. The problem occurs when we any alert dialog is clicked and then we go to Mediaplugin the above exception is thrown.
Thanks.
Please take another look at the article. This is not about permissions. It is about adding a use case description in info.plist. This has solved the exact same error for me.
https://devblogs.microsoft.com/xamarin/new-ios-10-privacy-permission-settings/ I found this solution
Thanks! This solved the issue for me.
Same problem here. Is there any way to get around this bug ?
FYI for others who might think that moving to xamarin essentials might solve your problem: We're getting the exact same issue through the Xamarin.Essentials.MediaPicker.PickPhotoAsync method. It isn't crashing our app because we're catching the error, but the error is the same.
**System.InvalidOperationException: Could not find current view controller.**
Platform.GetCurrentViewController (System.Boolean throwIfNull) D:\a\1\s\Xamarin.Essentials\Platform\Platform.ios.tvos.watchos.cs:96
MediaPicker.PhotoAsync (Xamarin.Essentials.MediaPickerOptions options, System.Boolean photo, System.Boolean pickExisting) D:\a\1\s\Xamarin.Essentials\MediaPicker\MediaPicker.ios.cs:51
@MitchBomcanhao how did you manage to catch the error? I wrapped my code with try-catch but my app crashes and does not reach the catch clause...
@Chasyl I can't recall where exactly I got the exception details from and I can't debug iOS at the moment. our code is just using a try-catch. just checking - are you trying this with the media plugin or with xamarin essentials? my latest comment was about a similar error still happening with essentials.
Crash after on calling CrossMedia.Current.PickPhotoAsync after closing DisplayAlert dialog.
Bug Information
{System.InvalidOperationException: Could not find current view controller at Plugin.Media.MediaImplementation.GetMediaAsync (UIKit.UIImagePickerControllerSourceType sourceType, System.String mediaType, Plugin.Media.Abstractions.StoreCameraMediaOptions options) [0x0009a] in <390f35b1db5e43b894d803204ceef8a9>:0 at Plugin.Media.MediaImplementation+d__21.MoveNext () [0x0017c] in <390f35b1db5e43b894d803204ceef8a9>:0
--- End of stack trace from previous location where exception was thrown ---
Version Number of Plugin: 4.0.1.5 Device Tested On: IOS Simulator Tested On: Version of VS: VS 2017 Version of Xamarin: 3.6.0.344457 Versions of other things you are using:
Steps to reproduce the Behavior
Expected Behavior
Actual Behavior