Problem: net::ERR_CONNECTION_REFUSED on debug apk

#1

Hi,

while testing the app i came across the problem that i can only run the app if ionic serve is running.
The case is that i wanted to make the app so that it runs without ionic serve or any serve for that matter.

are there perhaps any wrongs in my config.xml?

i thought that after building, you can run it without the use of ionic serve.

if i run the app without ionic serve turned on i get the error net::ERR_CONNECTION_REFUSED (http://localhost/)

behind this error there is an error which is ERR_FILE_NOT_FOUND(file:///android_asset/www/index.html)

android version is 7.1.2(it uses the custom rom from lineage os)

#2

Can try adding the below values in your config.xml

<preference name=“SplashMaintainAspectRatio” value=“true” />

<preference name=“FadeSplashScreenDuration” value=“300” />

<preference name=“SplashShowOnlyFirstTime” value=“false” />

<preference name=“SplashScreen” value=“screen” />

<preference name=“SplashScreenDelay” value=“3000” />

<preference name=“KeyboardDisplayRequiresUserAction” value=“false” />

<preference name=“AutoHideSplashScreen” value=“false” />

<preference name=“loadUrlTimeoutValue” value=“700000” />

#3

Excuses for the late response. I didn’t have the laptop which had the project.

my Config.xml looks is as follows.

<name>Project foo</name>
    <description>An awesome Ionic/Cordova app.</description>
    <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
    <content src="www" />
    <access origin="*" />
    <allow-navigation href="http://localhost:8080/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-device" spec="2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^3.0.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <allow-navigation href="http://localhost/" />
    <engine name="android" spec="7.1.4" />

There are some Ios and Android splashes in the middle as well, but i don’t think they matter in this scenario

EDIT:
After adding the other preferences i dont get net:ERR_connection_refused.
Instead the only error i get is FILE_NOT_FOUND

#4

problem has been solved.

<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>TriStar</name>
    <description>An awesome Ionic/Cordova app.</description>
    <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
    <content src="index.html" /> //changed from www to index.html
    <access origin="*" />
    <allow-navigation href="http://localhost:8080/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="KeyboardDisplayRequiresUserAction" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="loadUrlTimeoutValue" value="700000" />
    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-device" spec="2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^3.0.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <allow-navigation href="localhost:8080/*" />  // changed this into :8080
    <allow-navigation href="https://foo.bar/api/index.php" />
    <engine name="android" spec="7.1.4" />
#5

The error connection that occurs with the following part which will be going to manage it according to the part so it will be able https://netgears.support/blog/netgear-r6700-nighthawk-ac1750-review/ to provide the best way to identify the debug apk…