Installed apk generated by quasar dev / build command does not work in Android
-
I am building a quasar-framework app.
Running the “quasar dev -m cordova -T android -t mat” command, with mobile connected to the computer works correctly (picks my device’s IP as external IP)…
(The android version installed in my mobile is 5.1)
However, when I install the ‘apk’ generated by above command in mobile, it looks for the same external IP in mobile and says ‘cannot connect to 192…:/index.html’
When I use ‘build for production’ command (quasar build -m cordova -T android -t mat) and try to copy the apk generated, the device says ‘App cannot be installed’.
The exact error, when not connected to Internet, is:
The webpage at http://192…:8080/index.html could not be loaded because:
net: ERR_ADDRESS_UNREACHABLEWhen connected to Internet, it says:
The connection to the server was unsuccessful (http://…:8080/index.html) -
The dev build loads the site from your computer (the IP you see should be your computers internal IP). So in order to do so the host (you computer must be reachable).
On why the production build does not work I currently do not have a clue. Does it generate some other error message? -
Not sure… I am yet to see error messages (if any), thru’ USB debugging…
-
Were you able to fix the dev build? (Making sure you are in the same network)
-
- For dev, 192.x.x.x doesn’t seem like an external IP…
- If you manually want to install the production apk on your phone, please make sure that you first run “quasar build -m cordova -T mat” – this command generates the production-ready assets for Cordova, then Cordova builds the apk. If you still get “The webpage at http://192…:8080/index.html could not be loaded because” it means:
a. You’re still running the dev version of your app
b. Cordova errored out? Check if there are errors in the terminal.
-
@ksathya said in Installed apk generated by quasar dev / build command does not work in Android:
When I use ‘build for production’ command (quasar build -m cordova -T android -t mat) and try to copy the apk generated, the device says ‘App cannot be installed’.
Hey same here. Were you able to make it run and how do I see logs on the phone?
The command I run (I don’t see any error message during the process):
$ quasar build -m cordova -T android -t mat
Update:
I was able to fix my issue signing the apk as described in the docs. Not sure if I hijacked this thread, apologies if this happened. -
Hi,
After
quasar dev -m cordova -T android
without any error in my console, i have a white screen and an ‘Application error’ on the android phone that says ‘The connection to the server was unsuccessful. (http://172.xx.xxx.xx:8080/index.html)’.
The ip adress correspond to my computers internal IP. -
@rstoenescu said in Installed apk generated by quasar dev / build command does not work in Android:
d out? Check if there are errors in the ter
Hi, as I mentioned, when I build the app for prod and install, the device says ‘App cannot be installed’…
-
@sweetyy 172.x.x.x seems like a local IP, not an external IP. This is why it doesn’t works for you. It needs to be an external IP.
-
@ksathya Investigate why it can’t be installed. Refer to Cordova community. There is nothing that Quasar can do to break an apk generated by Cordova.
-
Hi,
I finally got a chance to debug the app using android studio and found the device could not be installed because it was ‘not signed’!
I followed the steps given in below SO link (especially answers by cfprabhu and Jon) and rebuilt for release…It installed without any issues!
Thanks for all!!
-
@ksathya yep!!! my earlier update confirms that! (sorry for not mentioning you). http://forum.quasar-framework.org/topic/1979/installed-apk-generated-by-quasar-dev-build-command-does-not-work-in-android/6
-
@rstoenescu worth to add it to the docs?
-
Well, the signing part is under the Publishing to Store, but I guess it can be mentioned in other places too. Thanks if you wanna make docs additions!
-
How to resolve that:
quasar build -m cordova -T android -t mat
cd src-cordova
cordova build -
It did not resolve for me ,any ideas. Thanks in advance.
-
@king_of_leon you need to sign the apk https://quasar.dev/quasar-cli/developing-cordova-apps/publishing-to-store#Android-Publishing, but if you’re just building for test, then just run the command
quasar build -m android --debug
. -
Thanks for the quick response, I want to permanently install in my android. I tried it after signing a key got stuck in jarsigne and zipalign. jarsigner says “Please specify jarfile name” but I did. And zipalign says not found command.
Appreciate the help
Great Community
-
that guide is all good, if you’re stuck somewhere then just google the error logs. anyway the --debug command is sufficient, the other is just needed if you are planning to publish your app in google app store.
-
Got it thank you so much . Loving this framework more and more!