Friends I have this problem that I can not use the camera with Xamarin Forms , I have problems with the perismos, I am guiding myself on this reference link
and it asks me to create a folder xml where I add the file file_paths.xml , but when I try to run it and send me the following 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>