plugin.media error

Asked

Viewed 52 times

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 called 'xml' and within 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 the Genymotion with Google Nexus 4 - 5.0.0 API 21, or Meno on my smartphone, generates the error as per attached image.

I’d appreciate it if someone could help me.

inserir a descrição da imagem aqui

1 answer

5

Replaces the following line:

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

for

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

I cleaned the solution and recompiled, everything worked perfectly.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.