I can not load jnilib


#1

I’m developing a Cordova plugin in my Ionic project. In the plugin I need to integrate C code (JNI), but when I try to run the app on an Android device I find the error that can not find the jniLib (System.loadLibrary (“JNI”)). The code works, tested on intellIj idea.

Cordova version: 8.0.0

Files:
–plugin
----src
------android
---------(some java files)
---------JNI.java
---------c_code
------------JNI.h
------------JNI.c
---------libJNI.jnilib
----www
----plugin.xml


#2

Don’t do this, create a seperate project for your plugin and use Plugman to create the basic scaffolding for your new plugin.

See: https://github.com/apache/cordova-plugman#create-method

Development

Use the ‘–link’ command to link the plugin to your project, for example:

To add the plugin to your project:

cordova plugin add --link ../cordova-plugin-abrakm-sdk

To remove the plugin from your project:

cordova plugin rm cordova-plugin-abrakm-sdk

To check your project’s plugins:

ionic cordova plugin ls

Production

To add the plugin to your project:

ionic cordova plugin add cordova-plugin-abrakm-sdk

To remove the plugin from your project:

ionic cordova plugin rm cordova-plugin-abrakm-sdk

Using ‘C’ code in Apache Cordova Plugins


Override files in mode_modules not work