Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Emulator is not able to open application in dev mode (doesn't see Vite server) #17725

Open
antonic901 opened this issue Dec 27, 2024 · 5 comments

Comments

@antonic901
Copy link

What happened?

When I start application for mobile development using this command:

quasar dev -m capacitor -T android

Android Studio opens, but I get error following error:
Screenshot_20241227_115129

What did you expect to happen?

App should open inside Android Emulator.

Reproduction URL

https://codepen.io/rstoenescu/pen/xxEvBLR

How to reproduce?

  1. Create initial Quasar Application using Quasar CLI
  2. Add Capacitor mode to project
  3. type quasar dev -m capacitor -T android
  4. Open Android Emulator

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Capacitor Mode

Platforms/Browsers

Android

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@github-actions github-actions bot added bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite mode/capacitor labels Dec 27, 2024
@fortxin
Copy link

fortxin commented Jan 2, 2025

I encountered the same issue and haven't found the root cause yet. My guess is that Quasar might not have successfully created the service in Capacitor mode. However, you can achieve the desired functionality indirectly using the following steps:

1.Start the app service with a specified port(same port as the second command)
quasar dev -p 9000 -m capacitor -T android
2.Start another service
In a new command line window, run the default development service (default port 9000):
quasar dev
This way, the app in Android Studio will be able to run and support hot reload.

@yusufkandemir yusufkandemir added bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. and removed bug/1-repro-available A reproduction is available and needs to be confirmed. labels Jan 2, 2025
@rstoenescu
Copy link
Member

Cannot reproduce.
Can you guys share more info on your setup? What OS are you using (and version). Also, what Android Studio are you on etc etc.

@rstoenescu rstoenescu removed the bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. label Jan 3, 2025
@mgurzixo
Copy link

mgurzixo commented Jan 5, 2025

Hello,
I got the same problem with a real android device. The dev server starts on spa but not with capacitor-android.
I was able to make it work again by downgrading to V0.15 launching quasar dev then re-upgrading to current version.
The commands are:
npm i -g [email protected]
quasar dev -m capacitor -T android
npm i -g quasar-cli

I have no explanation why it stopped working, then why it started working again :(

My config:

  • Android studio 2024.2.1
  • @quasar/app-vite 2.0.5 (@quasar/cli 2.4.1)
  • quasar-cli 0.17.26
  • Linux ubuntu 22.04.5 LTS

EDIT 01/07 In fact, this does not work. The dev server does not start

@Noxdor
Copy link

Noxdor commented Jan 6, 2025

I've run into the same issue:

Screenshot From 2025-01-06 15-15-13

It appears to me as if the dev server doesn't start. The first output is the result of running curl on my machines local ip address after I started up quasar dev. The second and third are while quasar dev -m capacitor -T android is running.
image

EDIT: What I want to show with the last picture: The server is up and running after calling quasar dev, but appears to not be up and running after calling quasar dev -m capacitor -T android.

npx quasar --version gives me @quasar/app-vite 2.0.5. Please tell me any further information I can provide to help fixing this issue.

@dominicenglish
Copy link

dominicenglish commented Jan 7, 2025

I have the same problem after upgrading to @quasar/app-vite@2.

  • quasar dev command works fine
  • quasar dev -m capacitor -T android doesn't throw any errors or warnings, appears to set up the android project fine but the dev server can't be connected to (ERR_CONNECTION_REFUSED). This includes manually going to the generated dev server url so doesn't appear to be anything to do with android studio or the android project directly.

EDIT: This comment originally had information about reproducing the error with a brand new quasar app but after rebooting my machine the dev server for the new quasar app now works correctly. Unfortunately my app is still broken with the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants