Reputation: 1608
I can't load any image from external url in real device. I am always getting the following error:
This is my capacitor.config.json
{
...,
server: {
cleartext: true,
hostname: "rootsmenu.com",
allowNavigation: [
'localhost',
'rootsmenu.com'
]
}
}
Upvotes: 1
Views: 5147
Reputation: 1608
I edited capacitor.config.ts
with following configs and it worked! Also, I was editig the wrong file android/app/src/main/assets/capacitor.config.json
. Because it was replaced with capacitor.config.ts
content each time I ran npx cap sync android
capacitor.config.ts
{
...
"android": {
"allowMixedContent": true
},
"server": {
"cleartext": true,
"hostname": "localhost"
}
}
Upvotes: 1