Load local file and get Unknown chromium error: -6

2019-06-20 05:03发布

问题:

I was trying to load a local file from the sdcard into a WebView. But since Android 4.1 it isn't working anymore, I always get the message: File not found and in LogCat

Unknown chromium error: -6.

回答1:

I figured out the Problem and I just needed to add one more slash. Example:

We need now:

loadURL("file:///.../file.file");

instead of:

loadURL("file://.../file.file");

Just add one more slash and it works. I hope this is helpful for all with the same issue under Android 4.1.