plugin.media error

3

I'm trying to use the Media Plugin for Xamarin and Windows with the Visual Studio Community 2017 . An android app that should have the ability to take some photos.

I followed the following guidelines:

In Resources, you added a folder named 'xml' and inside it I created a file by name file_paths.xml with the following code:

 <?xml version="1.0" encoding="utf-8"?>
    <paths xmlns:android="http://schemas.android.com/apk/res/android">
      <files-path name="my_images" path="images/"/>
      <files-path name="my_docs" path="docs/"/>
    </paths>

Then I opened the file AndroidManifest.xml and added the following code:

<application android:label="ReporOnLine.Android">
    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="${applicationId}.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
      <meta-data
          android:name="android.support.FILE_PROVIDER_PATHS"
          android:resource="@xml/file_paths" />
    </provider>     
    </application>

In the AssemblyInfo.cs file I added:

[assembly: UsesFeature("android.hardware.camera", Required = false)]
[assembly: UsesFeature("android.hardware.camera.autofocus", Required = false)]

When I try to debug the application using Genymotion with Google Nexus 4 - 5.0.0 API 21 , or less on my smartphone, it generates the error as attached image.

Thank you if anyone can help me.

    
asked by anonymous 31.08.2018 / 02:24

1 answer

5

Replace the following line:

android:authorities="${applicationId}.fileprovider" 

by

android:authorities="com.companyname.ReporOnLine.fileprovider"

I cleaned the solution and recompiled, everything worked perfectly.

    
31.08.2018 / 04:22