How to setup Cordova on the Quasar Framework?

After successfully developing my first Quasar V1 project with Cordova (and Vue), I decided to post all the commands and problems that made me lose a tremendous amount of time.

Make sure you bookmark this page as you will use it a lot!

Let’s start with the most important commands:

1) Create a new Quasar V1 project with:

quasar new store <store_name>

2) Add cordova to your Quasar project with:

quasar mode add cordova

3)To switch to your cordova project:

cd src-cordova

You should now found yourself in:


4)Add an Android platform to your Cordova project:

cordova platform add android

5)Add a splash screen plugin:

cordova plugin add cordova-plugin-splashscreen

6)Install very important plugins:

cordova plugin add cordova-plugin-camera
cordova plugin add cordova-plugin-device
cordova plugin add cordova-plugin-dialogs
cordova plugin add cordova-plugin-file
cordova plugin add cordova-plugin-geolocation
cordova plugin add cordova-plugin-media-capture
cordova plugin add cordova-plugin-request-location-accuracy
cordova plugin add cordova-plugin-splashscreen
cordova plugin add cordova-plugin-whitelist
cordova plugin add cordova-plugin-wkwebview-engine
cordova plugin add cordova-plugin-file-transfer
cordova plugin add cordova-plugin-inappbrowser

7)Install Vuelidate

npm install vuelidate --save

quasar new boot vuelidate

The boot command will generate a new file in:


Make sure you go to your quasar.conf.js

and have vuelidate here:

boot: [
'vuelidate', <-----

Go to the boot folder and create a file called vuelidate.js and add this code in it:

import Vuelidate from 'vuelidate';

export default async ({ app, Vue }) => {

8) 3 super important commands:

The below command will generate a web version of your app

quasar dev

This command will package your app

quasar build -m cordova -T android

After packaging your app, make sure your Android phone is plugged in, run the below command to send the app to your phone

cordova run android

I prefer to upload a proper APK to my phone to use all the Cordova features.

Problems you may encounter with vuelidate, here is an example on how to use it with a basic login page:

<div class="q-pa-md">
<div class="col"></div>
<div class="col-6">
<img src="~/assets/logo.png" style="width: 100%">
<p class="text-center text-h5 text-primary">Login</p>
<q-form @submit="onLogin" @reset="onReset" class="q-gutter-md">

<q-input outlined type="email" v-model="email" @blur="$$touch" label="Your email" error-label="Please add an email" :error="$$error"></q-input>

<q-input outlined type="password" v-model="password" @blur="$v.password.$touch" label="Your password" error-label="Please add your password" :error="$v.password.$error"></q-input>

<q-btn size="17px" label="Login" type="submit" color="positive" class="q-mr-sm" :disabled="$v.$invalid"/>
<q-btn size="17px" label="Reset" type="reset" color="primary"/>
<div class="col"></div>

import {
} from 'vuelidate/lib/validators';
export default {
data () {
return {
email: null,
password: null
validations: {
email: {
minLength: minLength(5),
password: {
minLength: minLength(6)

methods: {
onLogin () {
this.$store.dispatch('common/retrieveToken', {
password: this.password
onReset () { = null;
this.password = null;

Did you notice the local image? That’s how you can linked them to your project locally, drop them into src/assets/

<img src="~/assets/logo.png" style="width: 100%">

9)Routing from an action.js

Let’s say you create multiple modules and wish to send the user to a page from one action, you will have to use this:

export function resetAll (context) {
let vm = this;
vm.$router.push({ path: '/' });

10)Dispatching to any modules from anywhere in your app.

This is a problem that caused me a lot of troubles, here is the code:

this.$store.dispatch('common/clearCounts', null, {
root: true

In order to dispatch to a module, you have to add the path of the module, then ‘null’ if you have no parameters to send and finally { root: true }

11)Where to put all your alerts?

I personally like to have all my warnings and alerts in 1 single module here:

context.dispatch('alerts/alertRed', 'Our server is not responding', { root: true });

12)Setting up and accessing your local storage

Add an item to your localstorage

localStorage.setItem('accessToken', myItem);

Retrieve an item from your local storage


Delete all the local storage from Mutation:


13)When a user uninstall your app, the local storage is still there. This can be problematic if you use certain details that need to be reset on new install.

This is how you do it, go to your src-cordova/config.xml and add this code:

<widget id="" version="0.0.1" xmlns="" xmlns:android="" xmlns:cdv="">

As you can see, you must add:


And then also this:

<platform name="android">
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:allowBackup="false" />

I will keep adding more commands and tips as I continue working on different Quasar & Cordova projects.





















As an Amazon Associate I earn from qualifying purchases. This post may contain affiliate links which means I may receive a commission for purchases made through links.