jamesmontemagno / MediaPlugin

Take & Pick Photos and Video Plugin for Xamarin and Windows
MIT License
711 stars 360 forks source link

Crash when taping to Cancel after choose image #775

Open AnHuynh89 opened 4 years ago

AnHuynh89 commented 4 years ago

ONLY Post issues against Latest Beta!!!

Make sure you follow all of the setup directions before posting an issue: https://github.com/jamesmontemagno/MediaPlugin#important-permission-information

If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below.

Failure to fill out this information will result in this issue being closed. If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here.

Bug Information

System.InvalidOperationException at System.Threading.Tasks.TaskCompletionSource`1[TResult].SetResult (TResult result) [0x00009] in <0e400f473a3e4716a829e46ba2f1f0d6>:0 at Plugin.Media.MediaPickerDelegate.b__12_0 () [0x00000] in d:\a\2\s\src\Media.Plugin\iOS\MediaPickerDelegate.cs:109 at ObjCRuntime.Trampolines+SDAction.Invoke (System.IntPtr block) [0x00016] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/Trampolines.g.cs:14674 at (wrapper native-to-managed) ObjCRuntime.Trampolines+SDAction.Invoke(intptr) at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65 at TaikooSocial.iOS.Application.Main (System.String[] args) [0x00001] in/src/ios/Main.cs:17 --- End of stack trace from previous location where exception was thrown ---

at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65 at TaikooSocial.iOS.Application.Main (System.String[] args) [0x00001] in/src/ios/Main.cs:17 2019-11-28 11:55:07.112 TaikooSocial.iOS[688:116923] Unhandled managed exception: (System.InvalidOperationException) at System.Threading.Tasks.TaskCompletionSource`1[TResult].SetResult (TResult result) [0x00009] in <0e400f473a3e4716a829e46ba2f1f0d6>:0 at Plugin.Media.MediaPickerDelegate.b__12_0 () [0x00000] in d:\a\2\s\src\Media.Plugin\iOS\MediaPickerDelegate.cs:109 at ObjCRuntime.Trampolines+SDAction.Invoke (System.IntPtr block) [0x00016] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/Trampolines.g.cs:14674 at (wrapper native-to-managed) ObjCRuntime.Trampolines+SDAction.Invoke(intptr) at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65 at TaikooSocial.iOS.Application.Main (System.String[] args) [0x00001] in/src/ios/Main.cs:17 --- End of stack trace from previous location where exception was thrown ---

at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65 at TaikooSocial.iOS.Application.Main (System.String[] args) [0x00001] in/src/ios/Main.cs:17

Version Number of Plugin: 4.4.8-Beta Device Tested On: iPhone XR Simulator Tested On: NO Version of VS: Visual studio for MAC 8.3.10 (build 2) Version of Xamarin: Xamarin.Forms 3.6.0.709228 Versions of other things you are using:

Steps to reproduce the Behavior

  1. Pick a photo.
  2. Choose one after that tap to the cancel immediately

Expected Behavior

Don't crash app

Actual Behavior

Crash app

Code snippet

var file = await CrossMedia.Current.PickPhotoAsync(new PickMediaOptions { SaveMetaData = false })

Screenshots

XCBO9466.mp4.zip

yichen0831 commented 4 years ago

This problem still exists with version 5.0.1.