Cordova: Not allowed to load local resource: file:///

Viewed 589

Cordova build running on Quasar is giving error

Not allowed to load local resource: file:///data....

Added below to the config.xml

<allow-navigation href="file:///*" />
<access origin="file:///*" />

Also added the content-security-policy in index.html

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; media-src *; img-src * filesystem: file:">
1 Answers

this is due to some url be it image or configuration file is being used incorrectly for example

<image src = "/ logo.png" />

which is wrong and it should be so

<image src = ". logo.png" />

On the web it is not affected but on mobile it is.

check your layout and pages, especially App.vue in case you use preFetch

https://quasar.dev/quasar-cli/handling-assets

Related