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

    cordova is not defined"

    Framework
    7
    12
    4866
    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.
    • V
      vikram last edited by

      Hello guys,

      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 ,

      console.log(cordova)

      It says cordova is not defined"

      any Idea what could have gone wrong

      1 Reply Last reply Reply Quote 0
      • J
        JCharante last edited by JCharante

        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 cordova and then cordova platform add android, and then cordova run.

        Whenever you edit your quasar project, you will need to run quasar build again, and since /dist/ and /cordova/www/ are symlinked you just need to go into /cordova/ and run cordova run to 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

        V 1 Reply Last reply Reply Quote 0
        • a47ae
          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 this.$cordova

          V 1 Reply Last reply Reply Quote 0
          • V
            vikram @a47ae last edited by

            @a47ae

            this.$cordova
            .$cordova
            this.cordova

            1. undefined
            2. $cordvoa doesnt exist
            3. undefined
            1 Reply Last reply Reply Quote 0
            • V
              vikram @JCharante last edited by

              @JCharante

              I am using 0.13.10 I have already followed the steps provided and I am still getting cordova undefined

              1 Reply Last reply Reply Quote 0
              • eleina
                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 this.$cordova?

                1 Reply Last reply Reply Quote 0
                • J
                  JCharante last edited by JCharante

                  @eleina I believe it was @vikram who I was troubleshooting with on gitter. Not even this repo works for 'em.

                  V 1 Reply Last reply Reply Quote 0
                  • V
                    vikram @JCharante last edited by

                    @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

                    1 Reply Last reply Reply Quote 0
                    • J
                      JCharante last edited by

                      @vikram Try using crosswalk with cordova https://crosswalk-project.org/

                      1 Reply Last reply Reply Quote 0
                      • M
                        moringaman last edited by

                        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

                        1 Reply Last reply Reply Quote 0
                        • rstoenescu
                          rstoenescu Admin last edited by

                          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.

                          I 1 Reply Last reply Reply Quote 0
                          • I
                            iamyohanarias @rstoenescu last edited by

                            This post is deleted!
                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post