简体   繁体   中英

Failed to load resource on ionic emulate

My app works perfectly in browser but on emulating to android emulator, error " Failed to load resource " is thrown on fetching data from json-server running in my localhost.

With data from other links, i included whitelist plugin and Included

<meta http-equiv="Content-Security-Policy"> in index.html

Please help me where i am going wrong and why the resource is not loading for emulator when it does for browser. Thanks in advance.

when the app is in the emulator, localhost no longer means your computer, it means the emulator. You probably need to setup your server location so that it points to the ip address of your computer in the local network.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM