1

I use the latest NativeScript Sidekick and Preview for developing (vanilla, pure JS) apps, recently I installed Couchbase Lite Plugin https://market.nativescript.org/plugins/nativescript-couchbase

When I write var couchbaseModule = require("nativescript-couchbase"); in the JS file of a page and if I try to open the page, this error message shows up

But if I remove var couchbaseModule = require("nativescript-couchbase"); the page loads without error.

Why this happens? How can I use and require couchbase plugin? What can I do to solve this problem?

Microblaze
  • 15
  • 1
  • 5

1 Answers1

1

Limitations

The Preview app comes with a predefined set of NativeScript plugins. If your app utilizes a plugin that is not present in the Preview app, you will see a warning message and your app might not work as expected.

nativescript-couchbase plugin is dependent on their native libraries, so you must have complete environment setup to build your project locally in order to test it. Preview won't support this plugin.

Manoj
  • 21,753
  • 3
  • 20
  • 41
  • 1
    But building apk every time is time consuming and it reduces cloud builds, how can I preview my project with external plugins like couchbase and barcode scanner? or is there any easier way to test it with these plugins without having to build the app? – Microblaze Jan 31 '19 at 21:17
  • 1
    At least as of today, it's not possible at all. It's not a limitation with {N}. You must have to recompile your app when you have new native dependencies, Objective C / Java code requires a compiler unlike JavaScript which works with an interpreter. If you use any plugin that purely depends on JavaScript / any existing native libraries within your OS, you don't have to recompile, otherwise you must. You could setup Android SDK locally on your machine and build APK yourself. – Manoj Jan 31 '19 at 21:22