-1

I'm using this flutter social share plugin : appinio_social_share

I have problem with the following code in AndroidXML:

<provider android:name="androidx.core.content.FileProvider" 
    android:authorities="${applicationId}.[your_custom_fileProvider_path]"
android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/[your_custom_fileProvider_file_name]" />

What is this "your_custom_fileProvider_path"? Do I need to create a custom fileProvide class in android native code in order to use this plugin?

My Car
  • 4,198
  • 5
  • 17
  • 50

1 Answers1

0

What you need to do is create xml folder and add a provider path file to it (for example: provider_paths_app.xml) in android/app/src/main/res and add the lines below to the created xml file:

<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-path
        name="external_files"
        path="." />
</paths>

Later when you do this you change the [your_custom_fileProvider_path] to your fileProvider path and it should work

Vedo
  • 976
  • 4
  • 21
  • So if I created a xml file and named it provider_path.xml then I should replace [your_custom_fileProvider_path] with provider_path? There are 2 custom fields need to be filled - [your_custom_fileProvider_path] and @xml/[your_custom_fileProvider_file_name]. I believe the provider_path should go to xml/[your_custom_fileProvider_file_name] and most of the example I've seen they filed [your_custom_fileProvider_path] with package name like com.myapp.util.provider. why that's the case? – somebodyelse2022 Sep 30 '22 at 18:43