I installed the latest version of ionic, cordova and android studio with APK MANAGER with API 26.
Compiled the app: First:
ionic cordova platform add android
then: ionic cordova build android --release
and ionic cordova build android.
It generates the apk but when I put it in the phone it says:
‘aplication error could not connect to the server. (Http: // localhost: 8080)’
Attached photo of APK installed on Android with app-debug.apk
I did the test compiling in Windows and Debian and the same thing happens doing an example app of ionic: ionic start app1 tabs or blank this gives me an app-release-unsigned.apk file of 3.6MB and an app-debug.apk of 4.3MB . Being generally 600KB
Update ionic because it said it was outdated ioinic-cli this made the app-debug.apk of 4.3MB down to 1MB. Then I tried in android modelRocket version 4.4.2 and the fault persists, I tried with a model SM-G800H (SAMSUNG S5 mini) version 6.0.1 and installed it showing the blank app without problem shows what it should show. Then uninstall it and reinstall the same app and tell me that it can not be installed, restart the samsung and I still fail (And this should be another problem).
Previously I had compiled in the ROCKET 4.4.2 and had no problems. How can I make it recognize the previous versions of android?
Your Cordova tooling seems to be out of date, which might be causing all kinds of problems.
You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: How to update Cordova CLI, Platforms and Plugins · ionic.zone
@lucasbasquerotto also tried your proposal but it did not solve the problem. Thanks.
Now I do not understand why the apk file of a project ionic start app blank weighs 4.2Mb with ionic cordova build android and 1.1Mb with ionic cordova build android --prod when previously compiling this apk weighed 600Kb?