Android "No content provider found for permission check"

Viewed 342

This program is written in Delphi/Pascal, but I don't think this has much to do with language.

I'm having an issue launching a PDF from my application, which I assume is related to an error I see with adb logcat

04-23 19:45:23.315  1153  7393 W UriGrantsManagerService: No content provider found for permission check: content://com.embarcadero.XXXXX/pdfs/report.pdf
04-23 19:45:23.315  1153  7393 I ActivityTaskManager: START u0 {act=android.intent.action.VIEW dat=content://com.embarcadero.XXXXX/pdfs/report.pdf typ=application/pdf flg=0x1 cmp=com.google.android.apps.docs/com.google.android.apps.viewer.PdfViewerActivity} from uid 10630

Through a file explorer app, I have verified that the PDF is downloaded to and viewable from

/Android/data/com.embarcadero.XXXXX/files/Download/report.pdf

But for some reason when I launch the intent through my own app, it is not able to open.

I have setup my Manifest as follows:

        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="com.embarcadero.XXXXX.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/>
        </provider>

And I have defined provider_paths.xml as

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
  <external-path name="pdfs" path="./files/Download"/>
</paths>
0 Answers
Related