Hi all, I have searched on the Git repo, but cannot see any issues specifically related to this.
We are using Capacitor version 7 and are able to run the app in Android Studio with live-reload on an emulated device - happy days!
However, when we attempt to run on a real device, connected via USB, after the splash screen is displayed, the app fails to load, displaying a blank page. After a while, in both the Chrome debugger page, i.e. chrome://inspect/#devices > inspect on the device, and in the emulator, the blank screen changes to an Android error page:
Web page not available
The web page at http://192.168.75.221:4209/ could not be loaded because:
net::ERR_CONNECTION_TIMED_OUT
In our developer-local build, as per the Capacitor docs for the " Using with Framework CLIs" section, we have defined our capacitor.config.json
as follows, with the appropriate server
section:
...
"server": {
"url": "http://192.168.75.221:4209",
"cleartext": true,
"androidScheme": "http"
},
android: {
allowMixedContent: true
}
...
In the network_security_config.xml for this profile we have also added:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">10.0.2.2</domain>
<domain includeSubdomains="true">192.168.75.221:4209</domain>
</domain-config>
</network-security-config>
We are looking adding In-App Purchases, using RevenueCat, which recommends testing on a device and with live-reload this will be an awful development process, as it will not work in the browser and must be on device to use their SDK for mobile purchases.
I cannot see what we might have missed, so is there anything else required for live-reload to work on a USB connected device, rather than the emulator, or is this potentially a bug?
FYI - no issues with XCode and iOS, live-reload works like a charm there, along with Safari for dev console.
Many thanks in advance.
Paul