Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

[XLabs 2.0.0-pre91][Android] MediaPicker SelectPhotoAsync Crash

$
0
0

Hi Everyone,

I try to make a use of MediaPicker in Xamarin Forms and it works perfectly on iOS and Windows Phone but it crashes on Android.
It crashes wo no exception whatsoever as the Exception is null in the catch block.

I have a little more info in the output Window but I don't know what to do with this:
The class Android.OS.BaseBundle could not be loaded, used in XLabs.Platform.Droid

It have declared the permissions documented in my Android project :

Dependency Injection with SimpleInjector works fine and I have an instance of MediaPicker in my class.

Here's the failing code :

try
 {
    var options = new CameraMediaStorageOptions {DefaultCamera = CameraDevice.Front, MaxPixelDimension = 400};
    // It crashes here on Android. _mediaPicker is injected by constructor and has a non-null value.
    var mediaFile = await _mediaPicker.SelectPhotoAsync(options);

    var imageSource = ImageSource.FromStream(() => mediaFile.Source);
    ImageSource = imageSource;
}
catch (Exception ex)
{
    // ex is null following the crash
    Debug.WriteLine(ex.Message);
}

I use the last version of Xamarin on the Beta Channel.
The bug is reproduced on various emulator and on a Galaxy S4 Device.

Any idea to fix this issue is welcomed.

Thanks


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>