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

    Adding 3rd party plugins to capacitor app

    Framework
    4
    6
    1907
    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.
    • L
      luisdev last edited by

      I’m having an issue installing this “capacitor-navigationbar” plugin to my Capacitor app. I found my MainActivity.java file, however I do not know where I import the module as the plugin docs suggest I do. Any guidence will be extremely appreciated, thanks!

      both.png

      1 Reply Last reply Reply Quote 0
      • L
        luisdev last edited by

        Found out how its done:

        cd into src-capacitor folder: npm install capacitor-plugin-name

        then open file at src-capacitor/android/app/src/main/java/MainActivity.java

        there you will:
        import com.plugin-name
        and
        add(plugin-name)

        make sure neither your server nor your quasar client server is running otherwise you’ll get a bunch of ‘mkdir’ errors*

        then while remaining in src-capacitor you will run “npx cap sync android”

        go back to your quasar client and run “quasar dev -m capacitor -T android”

        make sure your server is still off and update your gradle on Android studio

        afterwards you will find the new plugin inside Plugins object in “@capacitor/core”

        you should be set to go. You’re welcome fellow newbie!

        1 Reply Last reply Reply Quote 3
        • D
          DavidGo last edited by

          I’m following those steps, but having an error:
          error: cannot access CordovaPlugin add(BarcodeScanner.class);
          class file for org.apache.cordova.CordovaPlugin not found

          1 Reply Last reply Reply Quote 0
          • D
            DavidGo last edited by

            Never mind, BarcodeScanner plugin works without adding it to MainActivity.java

            1 Reply Last reply Reply Quote 0
            • dobbel
              dobbel last edited by

              When using Capacitor or Cordova plugins you should never not have to change .java files.

              metalsadman 1 Reply Last reply Reply Quote -1
              • metalsadman
                metalsadman @dobbel last edited by metalsadman

                @dobbel in capacitor you do have to change it in some cases for registering plugins or when you are using local java files, it’s a nice feature of capacitor actually.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post