I am working to create a basic file explorer app in Android, and I'm stuck on how to get FileProvider working so I can allow my app access to other file areas than just the basic allotment Android grants you by default.
I have tried to follow the guides I have been reading (https://developer.android.com/training/secure-file-sharing/setup-sharing.html and a few others), but I am at a loss, specifically the problem seems to lie in the fact that my @xml/filepaths is not registering within my manifest, I get the error: "Top level element is not completed."
Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.hacktivity.datatemple">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="org.hacktivity.datatemple.fileprovider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And in my file res/xml/filepaths.xml, I have the following:
<paths>
<external-path path="/" name="root" />
</paths>