I'm trying to debug my Android app built with cordova over USB.
My device is showing up in adb and chrome://inspect
and I've port forwarded the device to connect to localhost:9000
.
I have confirmed that the port forwarding is working, since I can access localhost:9000
from Chrome on the device.
However when the app tries tp make a request to localhost:9000
, I get a 404 (Not Found) error.
I can copy the same address the app is trying to access and it opens correctly in Chrome on the device and also through the address bar of the webview inspector in Chrome devtools on my dev machine.
Why is my app unable to connect to localhost when Chrome can?
EDIT: The closest similar issue I could find was Android device communicate with local API server However the solution suggested, adding a CSP, didn't resolve my issue.
Some things I've tried to no avail:
- Added a CSP
- Updated the whitelist plugin
- Added
<allow-intent href="*" />
and<allow-navigation href="*" />
- Updated the CLI version
- Connecting with IP instead of
localhost
I probably forgot something, I've been working on and off on this for a while now. Any and all suggestions welcome. Thanks!