1
Hello I started an app with Ionic 4 by CLI, the same basic.
Commands used:
==> $ Ionic start app-build Blank --type=angular
==> $ app-build cd
==> $ Ionic Cordova Platform add android
==> $ Ionic Cordova build android
So far so good! I lift the app with the command $ Ionic serves to see if there is any error Javascript and good does not have.
Transfer the app to my device: Moto G1 | Android 4.4.4 and do the installation. When I run the app opens a dialog box with the title: Application Error and with the following error: net::ERR_CONNECTION_REFUSED(http://localhost:8080/)
OBS: Tested on a device: Samsung J5 | Android 6.0.0 and worked good!
Now I do not know if it can be Android version problems if you can help me I will be grateful.
How did you transfer to your device? Ionic Dev App, Ionic Cordova run android or installed apk? Note: For older versions of Android it is necessary to install the crosswalk-webview plugin.
ionic cordova plugin add cordova-plugin-crosswalk-webview
.– Renata
By any chance, are you not making any http request for localhost:8080? If it is, it won’t work at all, because your server won’t be on the localhost, but on your computer.
– Lucas Brogni
@Renata in the Ionic Dev App running normal, with $ Ionic Cordova run android I am not able to perform this way because my device does not appear connected to upload the app, yes I tested by installing the apk directly on the device. And you said of this plugin
ionic cordova plugin add cordova-plugin-crosswalk-webview
I added it and then went around$ ionic cordova build android
and gave error at compilation time.– Bruno Henrique
@Lucasbrogni I’m not making any requests, the app is dry, I created from scratch did not add anything. I created and compiled to test and did not run, but I believe it is something of the Android version because in a larger version, as I said above in the post worked. :(
– Bruno Henrique
Include the following in config.xml:
<allow-navigation href="http://localhost:8080/*"/>
, to grant localhost permission.– Renata
What was the build error after including crosswalk-webview?
– Renata
OK. I will try to add this configuration and I will answer you and also send you the error you gave.
– Bruno Henrique
@Renata you wanted to know what errors they gave when I installed the plugin you sent, follow the link with the errors prints https://imgur.com/a/BHUN55z
– Bruno Henrique
@Bruno Henrique this error probably occurred due to incompatibility of dependencies. You can include in
build.gradle
the following code:configurations.all {
 resolutionStrategy {
 force 'com.android.support:support-v4:27.1.0'
 }
}
– Renata
@Renata put the cited configuration in the file
build.gradle
and built it using the command$ ionic cordova build android
and still the error continues :(– Bruno Henrique