-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Comments
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) |
Cannot reproduce. |
Hello, I have no explanation why it stopped working, then why it started working again :( My config:
EDIT 01/07 In fact, this does not work. The dev server does not start |
I have the same problem after upgrading to
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.
|
This can be reproduced on both Windows and Linux on a brand new Quasar project.
Repeat the same command except pick Vite 2 on the first step, and the app will connect to the dev server successfully. |
@rstoenescu Besides GitHub, on Quasar Discord, many people say experiencing the same bug. Brand new template:
Then:
Then:
I've pushed the resulting repro there, so you can see all the dependencies in package.json: https://github.com/nicobao/quasar-repro-capacitor-dev-issue Android Studio Version:
OS: Debian GNU/Linux 12 (bookworm)
Android Studio logcat logs (Pixel 3a emulated app):
|
Seems the actual problem with the emulator comes from the fact that the dev server is actually not being started or bound to port 9500 - |
|
there is no service listening on port 9500. I opened a browser on no, I don't have any firewall that blocks, but again - as I mentioned, there is no service that listens on port 9500 after running ss -tunl | grep 9500 shows nothing. Same result with: lsof -i -P -n | grep LISTEN If I run |
just to mention - this was working just fine couple of weeks ago on my system. Today I upgraded Quasar (and quasar/app-vite) to the latest versions and now it doesn't work. |
Can you downgrade to the version that was working and tell me which that is, pls? |
hm.... I downgraded to quasar 2.17.4 with app-vite 2.0.0 but observe the same problem. Are there any logs that I could check (on linux)? Alternatively, how can I run the vite dev server on the command line - the one quasar is invoking when running |
unfortunately I'm not able to revert to a working setup. The strange thing is that My setup is:
I have also tried running |
I think this had to have been caused by a cached file. Make sure you've deleted I ended up commenting out most of my |
Hi, no it's not an old cache. It doesn't work with a brand new project created from the CLI, see repro https://github.com/nicobao/quasar-repro-capacitor-dev-issue |
What linux are you using (and version)? |
I confirm that is not the solution. Thank you for the suggestion, though! |
I am using Tuxedo OS, which is based on Ubuntu 24.04: uname -a ─╯
Linux r2-d2 6.11.0-108013-tuxedo #14tuxnoble1 SMP PREEMPT_DYNAMIC Mon Dec 16 18:07:37 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux I added Please check this comment above as well - they have the same issue with brand new quasar project on Debian 12. Additional info, if that would help: |
Update: this also happens on Windows 11! I just ran my project on a Windows 11 machine and same issue is happening - there is no node process listening on port 9500 when running Running On this Windows machine I am running node v20.11 with yarn v1.22.22. Here is my // Configuration for your app
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-file
import { defineConfig } from '#q-app/wrappers'
import { fileURLToPath } from 'node:url'
export default defineConfig((ctx) => {
return {
// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
// preFetch: true,
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli-vite/boot-files
boot: [
'event-bus',
'appwrite',
ctx.mode.capacitor ? 'capacitor' : '',
'router',
'app-init'
],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#css
css: [
'app.scss'
],
// https://github.com/quasarframework/quasar/tree/dev/extras
extras: [
// 'ionicons-v4',
// 'mdi-v7',
// 'fontawesome-v6',
// 'eva-icons',
// 'themify',
// 'line-awesome',
// 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both!
'roboto-font', // optional, you are not bound to it
'material-icons', // optional, you are not bound to it
'material-icons-outlined',
'mdi-v7'
],
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#build
build: {
target: {
browser: ['es2022', 'firefox115', 'chrome115', 'safari14'],
node: 'node20'
},
vueRouterMode: 'history', // available values: 'hash', 'history'
// vueRouterBase,
// vueDevtools,
// vueOptionsAPI: false,
// rebuildCache: true, // rebuilds Vite/linter/etc cache on startup
// publicPath: '/',
// analyze: true,
// env: {},
// rawDefine: {}
// ignorePublicFolder: true,
// minify: false,
// polyfillModulePreload: true,
// distDir
// extendViteConf (viteConf) {},
// viteVuePluginOptions: {},
vitePlugins: [
['vite-plugin-checker', {
eslint: {
lintCommand: 'eslint -c ./eslint.config.js "./src*/**/*.{js,mjs,cjs,vue}"',
useFlatConfig: true
}
}, { server: false }]
],
alias: {
includes: fileURLToPath(new URL('./src/includes', import.meta.url)),
classes: fileURLToPath(new URL('./src/classes', import.meta.url)),
composables: fileURLToPath(new URL('./src/composables', import.meta.url)),
'@capacitor': fileURLToPath(new URL('./src-capacitor/node_modules/@capacitor', import.meta.url)),
'@hugotomazi': fileURLToPath(new URL('./src-capacitor/node_modules/@hugotomazi', import.meta.url))
}
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#devserver
devServer: {
https: true,
open: false // opens browser window automatically
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#framework
framework: {
config: {
// global config for Loading plugin
loading: {
boxClass: 'bg-grey-10',
spinnerSize: 60
},
capacitor: {
backButton: false
}
},
// iconSet: 'material-icons', // Quasar icon set
// lang: 'en-US', // Quasar language pack
// For special cases outside of where the auto-import strategy can have an impact
// (like functional components as one of the examples),
// you can manually specify Quasar components/directives to be available everywhere:
//
// components: [],
// directives: [],
// Quasar plugins
plugins: [
'BottomSheet',
'Dialog',
'Loading',
'LocalStorage',
'Notify'
]
},
animations: 'all', // --- includes all animations
// https://v2.quasar.dev/options/animations
// animations: [],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#sourcefiles
// sourceFiles: {
// rootComponent: 'src/App.vue',
// router: 'src/router/index',
// store: 'src/store/index',
// pwaRegisterServiceWorker: 'src-pwa/register-service-worker',
// pwaServiceWorker: 'src-pwa/custom-service-worker',
// pwaManifestFile: 'src-pwa/manifest.json',
// electronMain: 'src-electron/electron-main',
// electronPreload: 'src-electron/electron-preload'
// bexManifestFile: 'src-bex/manifest.json
// },
// https://v2.quasar.dev/quasar-cli-vite/developing-ssr/configuring-ssr
ssr: {
prodPort: 3000, // The default port that the production server should use
// (gets superseded if process.env.PORT is specified at runtime)
middlewares: [
'render' // keep this as last one
],
// extendPackageJson (json) {},
// extendSSRWebserverConf (esbuildConf) {},
// manualStoreSerialization: true,
// manualStoreSsrContextInjection: true,
// manualStoreHydration: true,
// manualPostHydrationTrigger: true,
pwa: false
// pwaOfflineHtmlFilename: 'offline.html', // do NOT use index.html as name!
// pwaExtendGenerateSWOptions (cfg) {},
// pwaExtendInjectManifestOptions (cfg) {}
},
// https://v2.quasar.dev/quasar-cli-vite/developing-pwa/configuring-pwa
pwa: {
workboxMode: 'GenerateSW' // 'GenerateSW' or 'InjectManifest'
// swFilename: 'sw.js',
// manifestFilename: 'manifest.json'
// extendManifestJson (json) {},
// useCredentialsForManifestTag: true,
// injectPwaMetaTags: false,
// extendPWACustomSWConf (esbuildConf) {},
// extendGenerateSWOptions (cfg) {},
// extendInjectManifestOptions (cfg) {}
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-cordova-apps/configuring-cordova
cordova: {
// noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-capacitor-apps/configuring-capacitor
capacitor: {
hideSplashscreen: true
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-electron-apps/configuring-electron
electron: {
// extendElectronMainConf (esbuildConf) {},
// extendElectronPreloadConf (esbuildConf) {},
// extendPackageJson (json) {},
// Electron preload scripts (if any) from /src-electron, WITHOUT file extension
preloadScripts: ['electron-preload'],
// specify the debugging port to use for the Electron app when running in development mode
inspectPort: 5858,
bundler: 'packager', // 'packager' or 'builder'
packager: {
// https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
// OS X / Mac App Store
// appBundleId: '',
// appCategoryType: '',
// osxSign: '',
// protocol: 'myapp://path',
// Windows only
// win32metadata: { ... }
},
builder: {
// https://www.electron.build/configuration/configuration
appId: 'quasar-upgrade'
}
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-browser-extensions/configuring-bex
bex: {
// extendBexScriptsConf (esbuildConf) {},
// extendBexManifestJson (json) {},
/**
* The list of extra scripts (js/ts) not in your bex manifest that you want to
* compile and use in your browser extension. Maybe dynamic use them?
*
* Each entry in the list should be a relative filename to /src-bex/
*
* @example [ 'my-script.ts', 'sub-folder/my-other-script.js' ]
*/
extraScripts: []
}
}
}) |
I'm starting to think that there is something with your specific project folder or with Vite, but not with Quasar.
|
To add more to this on why I think that yours is a case of Vite silently failing: I have tested with a new Quasar project folder on a Linux and Windows and it works correctly. |
Seems like you are right - I have installed a new Quasar project with Let me dig deeper into my project setup and try to find what could be the problem. |
ok, found the culprit - deleting both thank you very much, @rstoenescu, for your help and guidance! |
Glad you got to the bottom of it! |
If it's not much, would you show this to your company pls? https://donate.quasar.dev |
What happened?
When I start application for mobile development using this command:
Android Studio opens, but I get error following error:
What did you expect to happen?
App should open inside Android Emulator.
Reproduction URL
https://codepen.io/rstoenescu/pen/xxEvBLR
How to reproduce?
quasar dev -m capacitor -T android
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
The text was updated successfully, but these errors were encountered: