capacitor: bug: setting anything in "allowNavigation" capacitor.config.json will provoke ERR_CONNECTION_REFUSED
Bug Report
Capacitor Version
npx cap doctor output:
đ Capacitor Doctor đ
Latest Dependencies:
@capacitor/cli: 1.4.0
@capacitor/core: 1.4.0
@capacitor/android: 1.4.0
@capacitor/ios: 1.4.0
Installed Dependencies:
@capacitor/cli 1.4.0
@capacitor/android 1.4.0
@capacitor/core 1.4.0
@capacitor/ios 1.4.0
[error] Main Acitivity â.MainActivityâ is not in manifest package âcom.bubblevr.wedoâ. Please update the packages to be the same.
Affected Platform(s)
- Android
- iOS
- Electron
- Web
Current Behavior
In order to fix some access issue (XHR call to these domains would be cancelled on iOS without it) I am setting the following json in capacitor.config.json
"server": { "allowNavigation": [ "localhost", "ec2-35-181-50-61.eu-west-3.compute.amazonaws.com:1337", "ec2-15-188-204-14.eu-west-3.compute.amazonaws.com:1337", "wedo-front-1670696535.eu-west-3.elb.amazonaws.com" ] }
But as soon as I set these, I get an error page on load of the app on android "the webpage at http://localhost/ could not be loaded because : net::ERR_CONNECTION_REFUSED.

I have also tried adding â*â in the listed of allowed origins, but I cannot get it to work. Removing the âallowNavigationâ array will let my app load properly.
Expected Behavior
Application load should not be blocked.
Other Technical Details
npm --version output:
6.4.1
node --version output:
v11.0.0
pod --version output (iOS issues only):
Other Information
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 22 (3 by maintainers)
Question similar to this⌠I have the exact same issue however, I donât have âlocalhostâ in âallowNavigationâ. I have my auth provider url in âallowNavigationâ only.
The idea is for the app to redirect to the auth provider, show the user the login flow, then redirect back to http://localhost/callback/âŚ
But I get the connect refused screen above.
Any other ideas?
same thing, still looking for solution
Add flag --external when emulating Android device. That will write external IP in the capacitor config instead of usual âlocalhostâ
can you try removing âlocalhostâ? a sample app would help too