title: IllegalArgumentException: Failed to find configuration root that contains xxx on FileProvider.getUriForFile
body: <p>I have been trying to follow the <a href="http://developer.android.com/training/secure-file-sharing/share-file.html">Android tutorial</a> on sharing files.
  I set up the <code>FileProvider</code> like this:</p>
  
  <p>On the main manifest xml:</p>
  
  <pre><code>&lt;provider
              android:name="android.support.v4.content.FileProvider"
              android:authorities="com.example.mysecondapp.fileprovider"
              android:exported="false"
              android:grantUriPermissions="true" &gt;
              &lt;meta-data
                  android:name="android.support.FILE_PROVIDER_PATHS"
                  android:resource="@xml/filepaths" /&gt;
          &lt;/provider&gt;
  </code></pre>
  
  <p>the res/xml/filpaths.xml file:</p>
  
  <pre><code>&lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;external-path name="myexternalimages" path="SpCars_album/" /&gt;
  &lt;/paths&gt;
  </code></pre>
  
  <p>And in my code I am trying the following:</p>
  
  <pre><code>File requestFile = new File(mImageFilenames[position]);
                  try {
                      fileUri = FileProvider.getUriForFile(
                              SeventhActivity.this,
                              "com.example.mysecondapp.fileprovider",
                              requestFile);
                  } catch (IllegalArgumentException e) {
                      Log.e("File Selector",
                              "The selected file can't be shared: " +
                                      mImageFilenames[position]);
                  }
  </code></pre>
  
  <p>The requestFile is instantiated with a proper working path for a file.
  The path of that file begins exactly with what <code>getExternalFilesDir(Environment.DIRECTORY_PICTURES)</code> returns.
  I just cant understand what raises the error because everything seems to fit.
  Thanks in advance.</p>