No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Installed apk generated by quasar dev / build command does not work in Android

    Help
    10
    22
    8298
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      ksathya last edited by

      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_UNREACHABLE

      When connected to Internet, it says:
      The connection to the server was unsuccessful (http://…:8080/index.html)

      P 1 Reply Last reply Reply Quote 3
      • a47ae
        a47ae last edited by

        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?

        1 Reply Last reply Reply Quote 0
        • K
          ksathya last edited by

          Not sure… I am yet to see error messages (if any), thru’ USB debugging…

          1 Reply Last reply Reply Quote 0
          • a47ae
            a47ae last edited by

            Were you able to fix the dev build? (Making sure you are in the same network)

            1 Reply Last reply Reply Quote 0
            • rstoenescu
              rstoenescu Admin last edited by

              1. For dev, 192.x.x.x doesn’t seem like an external IP…
              2. 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.
              K 1 Reply Last reply Reply Quote 0
              • P
                pd76 @ksathya last edited by pd76

                @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.

                1 Reply Last reply Reply Quote 1
                • S
                  Sweetyy last edited by Sweetyy

                  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 1 Reply Last reply Reply Quote 0
                  • K
                    ksathya @rstoenescu last edited by

                    @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’…

                    rstoenescu M 2 Replies Last reply Reply Quote 0
                    • rstoenescu
                      rstoenescu Admin @Sweetyy last edited by

                      @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.

                      1 Reply Last reply Reply Quote 0
                      • rstoenescu
                        rstoenescu Admin @ksathya last edited by

                        @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.

                        1 Reply Last reply Reply Quote 0
                        • K
                          ksathya last edited by

                          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!

                          https://stackoverflow.com/questions/26449512/how-to-create-a-signed-apk-file-using-cordova-command-line-interface

                          Thanks for all!!

                          P 1 Reply Last reply Reply Quote 1
                          • P
                            pd76 @ksathya last edited by

                            @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

                            1 Reply Last reply Reply Quote 1
                            • P
                              pd76 last edited by

                              @rstoenescu worth to add it to the docs?

                              1 Reply Last reply Reply Quote 0
                              • rstoenescu
                                rstoenescu Admin last edited by

                                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!

                                1 Reply Last reply Reply Quote 0
                                • E
                                  edudesouza last edited by

                                  How to resolve that:
                                  quasar build -m cordova -T android -t mat
                                  cd src-cordova
                                  cordova build

                                  1 Reply Last reply Reply Quote 1
                                  • king_of_leon
                                    king_of_leon last edited by

                                    It did not resolve for me ,any ideas. Thanks in advance.

                                    metalsadman 1 Reply Last reply Reply Quote 0
                                    • metalsadman
                                      metalsadman @king_of_leon last edited by

                                      @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.

                                      1 Reply Last reply Reply Quote 0
                                      • king_of_leon
                                        king_of_leon last edited by king_of_leon

                                        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 ❤

                                        1 Reply Last reply Reply Quote 0
                                        • metalsadman
                                          metalsadman last edited by

                                          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.

                                          1 Reply Last reply Reply Quote 0
                                          • king_of_leon
                                            king_of_leon last edited by

                                            Got it thank you so much . Loving this framework more and more!

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post