MediaPlugin: [iOS] iOS 14, ObjectDisposedException MediaPickerController
An ObjectDisposedException is thrown when taking photo with TakePhotoAsync. However it doesn’t crash and the photo can still be used.
Here is exception details:
System.ObjectDisposedException Message=Cannot access a disposed object. Object name: 'MediaPickerController'.
As you proposed I tried to migrate to Xamarin.essentials.MediaPicker unfortunatly it is currently missing options (at least AllowCropping, DefaultCamera and RotateImage) and the multiple pictures pick is not proposed.
Bug Information
Version Number of Plugin: 5.0.1 Device Tested On: iPhone XR Version of VS: 16.7.7 Version of Xamarin: 16.7.000.463 Versions of other things you are using: Version of Xamarin;iOS: 14.2.0.12
Steps to reproduce the Behavior
Call TakePhotoAsync
Expected Behavior
No exception thrown
Actual Behavior
An ObjectDisposedException is thrown
Screenshots

About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 18 (4 by maintainers)
Had a similar issue (probably the same) with the following stacktrace:
Versions: Xam.Plugin.Media: 5.0.1 iOS: 14.4 Xamarin.Forms: 5.0.0.2012 Visual Studio: 16.9.1 IDB: 16.9.000.271 Device: iPhone 12 Pro (Simulator)
@volcano619 thanks. I can confirm that so far my end user seeing this issue is unable to do so with the changes introduced. I must admit even they couldn’t reproduce it regularly though
If anyone wants to give a stab at fixing this issue, let me know and I will give you all some pointers! @volcano619 @callumideagen @flipper09112 @pspeybro !
Essentially, (save your changes first), then use the debuggable version of this library:
Then during the runtime
Hello, Any update on this issue? Cannot use xamarin essentials as we need to support image compression 😦 .