Android File Provider Illegal Argument Exception
<p>I am using file provider to save photo to a given destination.
I get:</p>

<p>java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data
while trying to open activity to capture image from camera.</p>

<p>My manifest.xml file:</p>

<pre><code>&lt;provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.example"
android:exported="false"
android:grantUriPermissions="true"&gt;
    &lt;meta-data
    android:name="android.support.FILE_PROVIDER_PATHS"
    android:resource="@xml/paths" /&gt;
&lt;/provider&gt;
</code></pre>

<p>My paths.xml file:</p>

<pre><code>&lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;external-path name="content" path="Android/data/com.my_package_name/files/" /&gt;
&lt;/paths&gt;
</code></pre>

<p>and Java code:</p>

<pre><code>File externalFilesDirectory = this.getExternalFilesDir(null);
File imageFile = File.createTempFile(
        imageFileName,
        ".jpg",
        externalFilesDirectory
);
Uri photoURI = FileProvider.getUriForFile(this, "com.example", imageFile);
</code></pre>

<p>Last line gives the exception.
What am I missing here? I've followed tutorial from official Android development site (<a href="https://developer.android.com/training/camera/photobasics.html" rel="noreferrer">https://developer.android.com/training/camera/photobasics.html</a>)</p>