Failed to load resource: net::ERR_FILE_NOT_FOUND i

2020-03-29 05:55发布

问题:

I have install whitelist plugin and in config.xml

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

but

i am getting error

Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/ion-autocomplete/dist/ion-autocomplete.css Failed to load   resource: net::ERR_FILE_NOT_FOUND
file:///css/ionic.app.css Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/ionic/js/ionic.bundle.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/ngCordova/dist/ng-cordova.min.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///cordova.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/moment/moment.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/angular-bootstrap/ui-bootstrap-tpls.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/angular-bootstrap-calendar/dist/js/angular-bootstrap-calendar-tpls.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/x2js/xml2json.min.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///lib/ionic-ajax-interceptor/dist/ionic-ajax-interceptor.min.js Failed to load resource: net::ERR_FILE_NOT_FOUND

It works fine when i test in browser but on testing on mobile device i am getting error above.

I have gone through all the solution available but can fix it at the moment

Thanks

回答1:

Try adding all of these

<access origin="*"/>
<access origin="tel:*" launch-external="yes"/>
<allow-navigation href="*"/>
<allow-navigation href="http://*/*"/>
<allow-navigation href="https://*/*"/>
<allow-navigation href="data:*"/>
<allow-intent href="*"/>
<access origin="*"/>

EDIT:

To your config.xml file



回答2:

See link.

remove <base href="/"> from your index.html



回答3:

I am getting same error,In my case my IP address was wrong.Check your if you are using IP address in your code.



回答4:

In my case, I changed I only changed in index.html

<base href="/" />

to

<base href="." />