0

If AndroidManifest.xml is generated, how can I add <provider>?

All the solutions I see say just add to AndroidManifest (Xamarin Forms File Provider not set).

intent.PutExtra(MediaStore.ExtraOutput, Uri.FromFile(AppClass._file));

Camera was working, updated android, now program is unhappy. Solutions say to update AndroidManifest with some version of...

<provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="${applicationId}.provider"`enter code here`
    android:exported="false"
    android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths"/>
</provider>
sba
  • 1,829
  • 19
  • 27
AKrist
  • 1
  • the Manifest is editable. When you open it you should have an option for switching to source view that allows you to directly edit the XML. – Jason Mar 19 '18 at 21:49
  • Thank you for answering. The problem is I edit it, build and it get's over written. It's a generated file I think. I seem to be missing something (silly probably). Using Visual Studio 2017, 15.5.7. – AKrist Mar 19 '18 at 22:29

2 Answers2

0

Ok, there are two AndroidManifest.xml files. Edit the one under Properties->AndroidManifest.xml. The other is the generated one.

AKrist
  • 1
0

I have always this bug, I have to remove the AndroidManifest file manually and add it from the (Right Click) Project Properties. Clean&Rebuild and it works for me.