Error Opening PDF in Web View on Android

When my app starts I download several PDFs to the local file system using the cache file step. I am then displaying the PDF in a web view by pointing to the local file location. This works fine on iOS but on Android (version 10) it says “Webpage not available” net::ERR_ACCESS_DENIED. I have given every permission I can think of that is related to files. When I first load the app I do get a prompt about accessing files and I allow it. They download fine and it just seems to be the viewing them that’s the problem. The PDF Preview works fine, but I don’t like that it opens in a modal and they can’t access the rest of the app while looking at the PDF.

Any ideas on the permission issue or on how to display (no modal) a local PDF without the web viewer?

Apparently this is a bug with newer versions of Android. I have implemented a work around to show the PDF preview if the os is android. This actually works okay since there is a back button that allows you to exit the modal. Looks like there is already a bug report on this issue.

1 Like