Capacitor for Android missing Java libs

I created this Capacitor plugin GitHub - phparch/capacitor-zebra-print-bt. I tried installing it with npm install capacitor-zebra-print-bt. However after install it seems to be missing the node_modules/capacitor-zebra-print-bt/android/libs/ZSDK_ANDROID_API.jar file even though it exists on the repo. I’ve searched for issues on NPM, Ionic, and Capacitor but haven’t found what I could be missing. If I install this plugin locally using npm install ../capacitor-zebra-print-bt it works as expected. Can anyone help enlighten me on if I’m missing a step or if there is a bug causing this in NPM? TIA.

I’m still having this issue when trying to upgrade this plugin for Capacitor 5. Does anyone have any thoughts of how I can get this to work so the ZSDK_ANDROID_API.jar gets copied over on an npm install?

So in the package.json you have

"files": [
    "android/src/main/",
    "android/build.gradle",
...
]

that means that for the android part of the plugin, only the main folder and build.gradle are being published to npm, but your jar file is in android/libs/ folder, so add that to the package.json too if you want it published.

1 Like

Thank you for the feedback. This is what I currently have for files:

  "files": [
    "android/src/main/",
    "android/build.gradle",
    "dist/",
    "ios/Plugin/",
    "CapacitorZebraPrintBt.podspec"
  ],

So I should also add android/libs/ to this if I want it included I assume? I’ll give that a try as that might be the missing piece. Thanks!

Thank you so much for your help with this @julio-ionic. I figured I was missing a configuration line someplace but I didn’t realize that’s what that section was doing. Thanks for monitoring the Discord and helping with this issue. :pray: Have a great day. :beers: