If you install a plugin for NativeScript that uses a native library for Android or iOS, follow the steps below and then send me a beer somehow.
- Uninstall the old build you are running on your emulator/device.
- Install the plugin into your app via the
tns plugin add...command.
tns build androidfor Android apps or
tns build iosfor iOS.
tns run androidor
tns run ios
That’s it! The plugin will now work, unless the maintainer(s) of the plugin just screwed things up 🙂 which I’ve done from time to time publishing plugins to npm.
If you care to know what those steps are actually doing, read on.
- Uninstalling an old build from the device/emulator will avoid any cache issues and continuing to run an old build without the third party native library will never work because it doesn’t exist in your compiled application.
- Create a new .apk or .ipa – during the build step the third party library will be downloaded and compiled into your executable assuming the plugin is configured correctly.
- Running the new executable will install the freshly built app onto your device or emulator.
If these steps don’t actually resolve the issue with using the plugin, you don’t owe me a beer.