java.lang.UnsatisfiedLinkError: Couldn't load hyphenate_av from loader dalvik.system.PathClassLoader

android studio引入第三方库时报如下异常。

06-15 16:50:24.477 9497-9497/easemobim.test.com.easemobim E/AndroidRuntime: FATAL EXCEPTION: main
        java.lang.UnsatisfiedLinkError: Couldn't load hyphenate_av from loader dalvik.system.PathClassLoader[dexPath=/data/app/easemobim.test.com.easemobim-1.apk,libraryPath=/data/app-lib/easemobim.test.com.easemobim-1]: findLibrary returned null
            at java.lang.Runtime.loadLibrary(Runtime.java:365)
            at java.lang.System.loadLibrary(System.java:535)
            at com.hyphenate.chat.EMClient.loadLibrary(Unknown Source)
            at com.hyphenate.chat.EMClient.getInstance(Unknown Source)
            at easemobim.test.com.easemobim.MainActivity.onCreate(MainActivity.java:57)
            at android.app.Activity.performCreate(Activity.java:5104)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1092)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2254)
            at android.app.ActivityThread.access$600(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5069)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
            at dalvik.system.NativeStart.main(Native Method)

  原因是android studio导入so文件没有编译到apk里面去,所以导致UnsatisfiedLinkError异常
  打开app下的build.gradle,在android的标签下加入如下代码:

  sourceSets {
        main {
            //jni库的调用会到资源文件夹下libs里面找so文件
            jniLibs.srcDirs = ['libs']
         }
        }

  如:

android {
    ... ...

    sourceSets{
        main{
            jniLibs.srcDirs = ['libs']
        }
    }

    ... ...
}

 

时间: 2024-08-02 06:38:48

java.lang.UnsatisfiedLinkError: Couldn't load hyphenate_av from loader dalvik.system.PathClassLoader的相关文章

求助java.lang.UnsatisfiedLinkError: Couldn't load hyphenate from loader dalvik.system.PathClassLoader

问题描述 java.lang.UnsatisfiedLinkError: Couldn't load hyphenate from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.chat-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.chat-1, /vendor/lib, /system/lib

Couldn't load hyphenate_av from loader dalvik.system。。。。。。

问题描述 Couldn't load hyphenate_av from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/mnt/asec/包名/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/包名/lib, /vendor/lib, /system/lib]]]: findLibrary returned null我用的是easeUI库,不可能缺少so文件怎么修改,但

java.lang.UnsatisfiedLinkError: Couldn't load hyphenate_av: findLibrary returned null

问题描述 用的是easeUI的library,参照ChatDemoUI3.0写的,运行直接报错:java.lang.UnsatisfiedLinkError: Couldn't load hyphenate_av: findLibrary returned null            at java.lang.Runtime.loadLibrary(Runtime.java:365)at java.lang.System.loadLibrary(System.java:535)at com.

java.lang.UnsatisfiedLinkError: Can't load library from JNI code

原文:http://www.velocityreviews.com/forums/t390018-java-lang-unsatisfiedlinkerror-cant-load-library-from-jni-code.html For System.loadLibrary() use the short name only, i.e. no path prefixor dll extension, and make sure the file is in java.library.path

java.lang.UnsatisfiedLinkError

问题描述 java.lang.UnsatisfiedLinkError Exception in thread "main" java.lang.UnsatisfiedLinkError: javax.microedition.lcdui.Font.init(III)V at javax.microedition.lcdui.Font.init(Native Method) at javax.microedition.lcdui.Font.(Font.java:198) at java

集成3.0easeui,java.lang.UnsatisfiedLinkError:

问题描述 我从easeui里面的libs拿出来放到自己的Lib里面,在魅族5.1.1手机上能运行,在genymotion报了上面的错,在小米手机貌似也是报这个错java.lang.UnsatisfiedLinkError: Couldn't load hyphenate from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.ml.lost-2.apk,libraryPath=/data/app-lib/com.ml.los

我在使用System.load(path);报了一个异常java.lang.UnsatisfiedLinkError

问题描述 我在使用System.load(path);报了一个异常java.lang.UnsatisfiedLinkError: Can't load library:+ pathpath 为D:/Program Files/Apache Software Foundation/Tomca 6.0/webapps/o3shoe/WEB-INF/SentinelKeysJDK.dll,但是该目录下又存在这个SentinelKeysJDK.dll文件 问题补充:这个文件是获取加密狗信息使用的,在ma

java.lang.UnsatisfiedLinkError: ctest.test.decrypt([BLjava/lang/String;)([B

问题描述 错误:Exceptioninthread"main"java.lang.UnsatisfiedLinkError:ctest.test.decrypt([BLjava/lang/String;)[Batctest.test.decrypt(NativeMethod)atctest.test.main(test.java:34)我在做jni的demo的时候出现以上错误java代码:packagectest;importjava.io.File;/***<p>Titl

Caused by: java.lang.UnsatisfiedLinkError...问题的解决

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load BaiduMapVOS_v2_1_3: findLibrary returned null 在使用百度地图的时候碰到了这问题 网上搜了下各种方法 都不顶用 我想死的心都有了..有没有碰到过这问 题的 求分享下经验啊. 后来看了百度地图sdk的demo以后,是因为有一个文件 liblocSDK.so,必须放在 libs/armeabi 目录下.将其对应的 liblocSDK.so拷到相