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

    Android Real Device to Test Dev App - Application Error

    Help
    4
    12
    1316
    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.
    • S
      susansiow last edited by

      I am having issue to launch my dev app on my Android device, the error messages:

      Application Error
      The connection to the server is unsuccessful
      
      Application Error
      net:: ERR_CONNECTION_TIMED_OUT (http://<ip address>:8080)
      

      For dev SPA, I can only access it via http://localhost:8080 and not http://<ip address>:8080 on my computer’s Chrome browser. With this clue, I’ve tried to troubleshoot the issue by launching the dev mobile app from:

      quasar dev -m android --device
      

      To the following command (with the guidance of Quasar documentation):

      quasar dev -m android --device -H localhost -p 8080
      

      However, I’m still getting the errors mentioned on top as the dev app is launching from http://<ip address>:8080, instead of http://localhost:8080?

      screnshot.png

      Any help or advice will be very much appreciated, thanks!

      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @susansiow last edited by

        @susansiow

        In quasar.conf.js file you can define your dev machine/host ip address ( and port number).

        devServer: {
            // https: true,
           port: 8080,
            //host: 'localhost',
           host: '192.168.2.35',
        },
        
        1 Reply Last reply Reply Quote 0
        • S
          susansiow last edited by susansiow

          Hi @dobbel ,

          (1) I’ve edited the quasar.conf.js file with the following:

          devServer: {
                https: true,
                port: 8080,
                host: 'localhost', 
                open: true
              },
          

          (2) Deleted the previously built dev cordova app on my Android device.

          (3) Rerun the dev command on the PC terminal.

          quasar dev -m android --device
          

          (4) But I am still getting the same error on my device.

          Application Error
          net:: ERR_CONNECTION_TIMED_OUT (http://<ip address>:8080)
          

          Please advise what other details I should provide for further troubleshooting purpose, thanks.

          ps: Any reason why I can only access the server through localhost but not ip address, is it caused by anti-virus software?

          dobbel 1 Reply Last reply Reply Quote 0
          • dobbel
            dobbel @susansiow last edited by dobbel

            @susansiow

            You did not do what I told you to do.

            For your android device to be able to connect to your host, put under host your dev machine’s local ip address instead of localhost:

            devServer: {
                  // https: true,
                  port: 8080,
                  host: '192.168.30.200',  // your local ip adr of YOUR dev machine
                  open: true
                },
            

            Also be SURE that the wifi network of your Android phone’ is the same as your dev computer’s network.

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

              Hi @dobbel

              I’ve edited the quasar.conf.js accordingly but it’s rendering the same error - Application Error: The connection to the server was unsuccessful.

              devServer: {
                    // https: true,
                    port: 8080,
                    host: '<ip address>',  // obtained from ipconfig - IPv4
                    open: true
              },
              

              Thus, I went ahead to test the dev web app alone by running the quasar dev command, the result is as what I’ve mentioned on top, my dev machine cannot serve with <ip address>:8080 but localhost:8080.

              Kindly advise, thank you!

              dobbel 1 Reply Last reply Reply Quote 0
              • dobbel
                dobbel @susansiow last edited by

                @susansiow

                If you cannot connect to your own machine’s local ip4 network address you should solve that first.

                S 1 Reply Last reply Reply Quote 1
                • S
                  susansiow @dobbel last edited by

                  @dobbel

                  I’m very new on mobile development, may I know what’s the main cause in general? Is it firewall or anti-virus software?

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

                    @susansiow yes you need to open up the firewall and the device should be in the same network as your dev machine.

                    S 1 Reply Last reply Reply Quote 1
                    • S
                      susansiow @metalsadman last edited by

                      Hi @metalsadman

                      Yes, the computer and Android device are on the same WIFI network.

                      I’ve been working hard to search for a solution and fix the issue. At my Windows computer, I’ve opened the 8080 port at Windows Defender Firewall - Inbound Rules and enabled ‘Internet Connection Sharing Mode’ in my anti-virus program.

                      screenshot2.png

                      However, when I run quasar dev -m android --device, my Android device will automatically launch the dev app with the same error.
                      screenshot.png

                      On the contrary, if I run quasar dev alone, both of my computer and Android device can see the test app via localhost:8080, which means both can access <host name>:8080 and not <local ip address>:8080.

                      May I know why the following codes at quasar.conf.js and terminal command cannot force the dev app to be launched via localhost:8080?

                      devServer: {
                            port: 8080,
                            host: 'localhost', 
                            open: true
                      },
                      
                      quasar dev -m android --device -H localhost -p 8080
                      

                      Is there other forcing or redirection methods that I can place in quasar.conf.js or apply at the terminal?

                      dobbel 1 Reply Last reply Reply Quote 0
                      • dobbel
                        dobbel @susansiow last edited by dobbel

                        @susansiow

                        Please remove AVG completely( even just to test) . This is 99,9% the reason why connecting to port 8080 is blocked. “Internet Connection Sharing Mode” is not at all the same as “open all ports”. Btw anti virus is not going to protect you from any modern malware.

                        Disable windows firewall completely ( unless you are directly connected to the internet without a router).

                        localhost is never going to work, even if you see the test app on your android phone. This is because dev creates a connection( for debug/hot reload, ect) to your dev machine.

                        S 1 Reply Last reply Reply Quote 1
                        • S
                          susansiow @dobbel last edited by

                          @dobbel

                          The latest solution provided by AVG tech team solves the issue - switch the Network Profile from 'Public' to 'Private', thank you!

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

                            Great post, a lot of stuff in here i did not know about

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