Adding local/custom plugin

nativescriptcore
plugins

#1

I have created a plugin to use native c/c++ library. I also added in Package.json and mention the file path and did npm install also. But during compilation i see only npm plugins are added but my own plugin is not getting listed. When i try to run the app it is crashing with the below error,

System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:
System.err: Error calling module function
System.err:
System.err: Error: com.tns.NativeScriptException: Failed to find module: “ABC-plugin”, relative to: app/tns_modules/
System.err: com.tns.Module.resolvePathHelper(Module.java:146)
System.err: com.tns.Module.resolvePath(Module.java:55)
System.err: com.tns.Runtime.runModule(Native Method)


#2

@Arvinth
Could you provide more detailed information about your plugin structure, how you’ve added it, and how you plan to expose it to Java/JavaScript.


#3

you have a problem with your plugin path, try to add the full plugin path in Package.json like on mac it will be

"file:///Users/myusername/mypluginFolder"

and make sure you requiring it correctly in your in your code


#4

Did you use the nativescript plugin seed to create a nativescript plugin first?
or are you planning to use the library directly in your app?
if you are planning to use it directly, then you wouldn’t want to add it to package.json