Version Number of Plugin: 3.0.1
Device Tested On: Nexus 7 (API 22 & 23)
Simulator Tested On:
Version of VS: Last stable
Version of Xamarin: Last stable
Versions of other things you are using:
Set targetSdkVersion to 24 or 25 in manifest and try to use TakePhotoAsync (only tested on version < 24)
Should present the camera view
Crash with log available there https://gist.github.com/Julien-Mialon/24d3251f518d6c9e137576f51d07d324
Looking to android source for the plugin, narrowing the problem to those lines when calling FileProvider.GetUriForFile https://github.com/jamesmontemagno/MediaPlugin/blob/master/src/Media.Plugin.Android/MediaPickerActivity.cs#L156-L166
Workaround available : set targetSdkVersion to 23.
Thanks for the bug report, I am able to reproduce this on Google Pixel running Android O
Marking this confirmed
Steps to reproduce:
CrossMedia.Current.TakePhotoAsyncSorry, spoke too soon.
This is not a bug, you need to add the file provider and file_path.xml when targeting API level 24 or higher
See more info here
https://github.com/jamesmontemagno/MediaPlugin#android-n
Please reopen of the issue if you continue to have a problem
Hi, I am having the exact same issue as Julien-Mialon,
I have tried the steps in https://github.com/jamesmontemagno/MediaPlugin#android-n, but it still crashes with targetSdkVersion to 24 or 25.
The workaround, set targetSdkVersion to 23 worked for me.
@raymondchoong that's rather strange. Could you share the sample project? Make sure you delete _bin, debug, and packages_ folder when sharing the sample
I can confirm that I've experienced this issue as well. Even though I was able to display the camera, when I take the picture, the application still crashes when I return back into the application. I've tried throwing a try-catch but my application doesn't catch an exception.
I'm going to see if I can generate a log file and compare to see if you issues are similar but I can also confirm that I was only able to get the camera to display when I implemented the suggested work around.
Run the sample, works just fine. You need to add the files xml to your app
Yes. Working fine for version 24. Problem was with my file-paths.xml having the wrong tag.
Changed from <external-files-path> to <external-path>