UnsatisfiedLinkError:无法从加载程序加载... [英] UnsatisfiedLinkError: Couldn't load ... from loader

查看:68
本文介绍了UnsatisfiedLinkError:无法从加载程序加载...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7中使用IntelliJ,最近对我的开发系统(而非设备)进行了突然更改后,我陷入了 System.loadLibrary()用于加载本机 .so

I'm using IntelliJ in Windows 7 and after a recent sudden change to my development system (not device) I'm stuck with the UnsatisfiedLinkError thrown by System.loadLibrary() for loading a native .so library

java.lang.UnsatisfiedLinkError: Couldn't load ... from loader 

我尝试了有关SO的所有建议修复,但都没有成功,

I tried every fix suggested on SO with no success including:

  • 重新构建应用并重新创建模块结构
  • 清理IntelliJ缓存并重新启动Intellj

我的.so库位于 libs 文件夹

I have my .so libraries in the libs folder

    • armeabi
    • x86

    推荐答案

    未加载的 .so 库位于我的主应用程序中.主应用程序依赖于另一个名为 X 的模块,该模块在以下层次结构中具有.so文件:

    The .so library which was not loading was in my main app. The main app is dependent on another module named X which have a .so file in the following hierarchy:

      • armeabi-v7a

      我注意到,将此模块添加到项目中会阻止加载主模块本机库.

      I've noticed that adding this module to the project prevented main module native libs to be loaded.

      这两个 libs 文件夹之间似乎存在冲突,因此让两个 .so 文件都加载的唯一疯狂的解决方法是重命名 armeabi-v7a 模块X中的/code>文件夹到 armeabi ,现在一切正常.

      It seems that there's a conflict between both libs folders so the only crazy fix that let both .so files get loaded was to rename armeabi-v7a folder in module X to armeabi and now everything is OK.

      这篇关于UnsatisfiedLinkError:无法从加载程序加载...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆