question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nothing happens on iOS 10.3 on PickPhotoAsync or TakePhotoAsync

See original GitHub issue

Bug

Version Number of Plugin: 2.6.2 Device Tested On: iPhone SE 10.3 Simulator Tested On: iPhone SE 10.3, iPhone 6 10.3

Expected Behavior

Show image picker or camera

Actual Behavior

Nothing shows… also no exception thrown… Untill I try to do it for the second time… then an Exception is shown (null Exception)

Steps to reproduce the Behavior

Code for TakePhotoAsyn:

var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
                    {
                        Name = System.Guid.NewGuid().ToString("D") + ".jpg",
                        SaveToAlbum = true,
                        AllowCropping = true,
                        PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium,
                        CompressionQuality =70
                    });

                    if (file == null)
                    {
                        UserDialogs.Instance.Toast(AppResources.dialog_error_save_image);
                        return;
                    }

Code for PickPhotoAsync:

                   var file = await CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions
                    {
                        CompressionQuality=70,
                        PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium,
                    });
                    if (file == null)
                        return;
                    else
                        await Navigation.PushAsync(new SendImagePage(file, selectedContainer));

It works perfectly on Android! I’ve also added the rows to info.plist file:

<key>NSCameraUsageDescription</key>
	<string>This app needs access to the camera to take photos.</string>
	<key>NSPhotoLibraryUsageDescription</key>
	<string>This app needs access to photos.</string>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
patrickfrank86commented, Apr 26, 2017

I had that problem as well, if I doesn’t call it directly from a buttons “Clicked” event. Try to put your code in Device.BeginInvokeOnMainThread(async () => { //code here }); This is working for me.

0reactions
jamesmontemagnocommented, Jun 5, 2017

Closed as there are multiple work around and already fixed in: Xam.Plugin.Media 2.7.0.50-beta +

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin.Forms and Plugin.Media: after about 20 photos ...
The problem occurs after taking about 20 photos (depends from the device): ... 10.3.1 and they have enough space to storage photos.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found