cordova is not defined"
I have installed Quasar just the way its recommended in the Doc , and then I added a cordova plugin ,
I checked in the cordova xml file the plugin exsist , when I do cordova plugins in CLI it properly list the plugin ,
But when I tried to acces the plugin in App.vue componenet inside mounted hook ,
It says cordova is not defined"
any Idea what could have gone wrong
Are you using 0.13.10 or 0.14 beta? I think these instruction should work for either http://beta.quasar-framework.org/guide/cordova-wrapper.html
Assuming you have cordova installed & up to date, go into your quasar project folder. Run
quasar wrap cordova; quarsar build, then
cd cordovaand then
cordova platform add android, and then
Whenever you edit your quasar project, you will need to run
quasar buildagain, and since
/cordova/www/are symlinked you just need to go into
cordova runto test it out on your phone again. You shouldn’t need to modify any files in
/cordova/www/, because if you do they will be overwritten.
Also for future reference you’d want to post this under the Help Category
a47ae last edited by
Without trying myself, but according to the docs http://beta.quasar-framework.org/components/vue-prototype-injections.html#Mobile-Apps
it should be
$cordova(note the $ sign). Also if you call it from within a component, it should be
- $cordvoa doesnt exist
I am using 0.13.10 I have already followed the steps provided and I am still getting cordova undefined
eleina last edited by
I think the application only knows Cordova when you’re debugging from the cordova app. When do you try to call
@JCharante Hey so did this work for you ? I see some commits .
@eleina so JC has forked my repo and did some changes have a look on that one , I ran the app in My mobile app and tried testing through the remote device debuggin tool of chrome , I get following error
vendor.js:11 Uncaught TypeError: e.$parent.close is not a function at click (vendor.js:11) at HTMLButtonElement.t (vendor.js:6)
and cordova undefined
The answer to this is to use navigator instead of the cordova keyword to access plugins i.e. you can use
navigator.camera.getPicture()to use the camera plugin.
see issue #792 for clarification of this: https://github.com/quasarframework/quasar/issues/792
If it’s related to #792 please note that “cordova” is available, but when using a Cordova plugin please read each plugin’s documentation page.
This post is deleted!