flutter_pdfview icon indicating copy to clipboard operation
flutter_pdfview copied to clipboard

java.io.FileNotFoundException: No content provider (Android)

Open dpelluzi-darwin opened this issue 3 years ago • 5 comments

My app does a download and save the file in temporary directory. I use a File object to pass its path in PDFView(filePath). In iOS it works fine but in Android I got a java.io.FileNotFoundException: No content provider. In Android, the path is somethine like /data/data/my.app/cache/file.pdf.

I figured out that I have to pass file://<file_path> in PDVView() to show it in Android, but not in iOS.

Is there any solution that works in both platform?

dpelluzi-darwin avatar Nov 30 '23 18:11 dpelluzi-darwin

I have the same problem

belyaj avatar Jan 31 '24 13:01 belyaj

I have the same problem.

thirstyde avatar Feb 01 '24 07:02 thirstyde

I have the same problem. java.io.FileNotFoundException: No content provider

yfming93 avatar Jul 04 '24 02:07 yfming93

I have the same problem

wgziOS avatar Oct 31 '24 00:10 wgziOS

I have the same problem.

Eldar2021 avatar Apr 07 '25 04:04 Eldar2021

Closing as resolved in 1.4.5 (also included in 1.5.0-beta.1 Kotlin/Swift migration).

Fixed: absolute filesystem paths on Android load via fromFile instead of a content-provider URI (no more No content provider).

Try it

dependencies:
  flutter_pdfview: ^1.4.5
  # or pin the migration beta:
  # flutter_pdfview: 1.5.0-beta.1

If you still reproduce on 1.4.5+ / 1.5.0-beta.1, please reopen with platform + OS version, flutter --version, minimal repro, and expected vs actual.

Related: #351 (1.5.0-beta feedback), #346 (1.4.5 feedback)

endigo avatar Aug 03 '26 09:08 endigo