Amigos tengo este problema de que no puedo usar la cámara con Xamarin Forms, tengo problemas con los perismos , me estoy guiando de esta referencia https://github.com/jamesmontemagno/MediaPlugin/blob/master/README.md#android-file-provider-setup
y me pide crear una carpeta xml en donde agrego el archivo file_paths.xml , pero cuando trato de correrlo y me mande el siguiente error
Error 12: error: Error: No resource found that matches the given name (at 'resource' with value '@xml/file_paths'). PhotoCam.Android C:\Users\erpre\Source\Repos\PhotoCam\PhotoCam\PhotoCam.Android\obj\Debug\android\manifest\AndroidManifest.xml
private async void TmPic(object sender, EventArgs e) {
await CrossMedia.Current.Initialize();
if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported) {
await DisplayAlert("Error", ":c Cámara no disponible.", "Continuar");
return;
} else {
var file = await CrossMedia.Current.TakePhotoAsync(
new StoreCameraMediaOptions {
Directory = "Images",
Name = DateTime.Now + "_img.jpg"
});
if (file == null) {
return;
myImg.Source = ImageSource.FromStream(() => file.GetStream());
}
}
}
file_paths.xml
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-files-path name="my_images" path="Pictures" />
<external-files-path name="my_movies" path="Movies" />
</paths>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.PhotoCam" android:installLocation="auto">
<uses-sdk android:minSdkVersion="12" android:targetSdkVersion="25" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<application android:label="PhotoCam.Android" android:icon="@drawable/icon">
<provider android:name="android.support.v4.content.FileProvider" android:authorities="com.PhotoCam.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
</provider>
</application>
</manifest>