Adding 3rd party plugins to capacitor app



  • 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



  • 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!


Log in to reply