在Cordova插件中找到java-lang-unsatisfiedlinkerror-no-implementation-找到

时间:2019-02-20 09:38:36

标签: cordova-plugins

当我创建cordova插件并添加jniLib并从android studio运行项目后,然后 java-lang-unsatisfiedlinkerror 抛出此错误,请给我任何建议,我已从2天开始解决了此问题,但没有为此找到了解决方案:

Plugin.xml

<source-file src="src/android/jniLibs/arm64-v8a/libhello-jni.so" target-dir="app/src/main/jniLibs/arm64-v8a"/>
    <source-file src="src/android/jniLibs/armeabi/libhello-jni.so" target-dir="app/src/main/jniLibs/armeabi"/>
    <source-file src="src/android/jniLibs/armeabi-v7a/libhello-jni.so" target-dir="app/src/main/jniLibs/armeabi-v7a"/>
    <source-file src="src/android/jniLibs/mips/libhello-jni.so" target-dir="app/src/main/jniLibs/mips"/>
    <source-file src="src/android/jniLibs/mips64/libhello-jni.so" target-dir="app/src/main/jniLibs/mips64"/>
    <source-file src="src/android/jniLibs/x86/libhello-jni.so" target-dir="app/src/main/jniLibs/x86"/>
    <source-file src="src/android/jniLibs/x86_64/libhello-jni.so" target-dir="app/src/main/jniLibs/x86_64"/>

HelloJni.java

public native int heartRateFromJNI ();

static {
    try {
       System.loadLibrary("hello-jni");
    } catch (OutOfMemoryError e) {
        log.error("OutOfMemoryError while loading lib");
    } catch (StringIndexOutOfBoundsException e) {
        log.error("StringIndexOutOfBoundsException while loading hello-jni lib");
    } catch (UnsatisfiedLinkError e) {
        log.error("UnsatisfiedLinkError while loading lib");
        Log.d("hello-jni", "hello-jni library not found!");
    }

}

0 个答案:

没有答案