Android的NDK java.lang.UnsatisfiedLinkError中:findLibrary返回NULL [英] Android NDK java.lang.UnsatisfiedLinkError: findLibrary returned null

查看:104
本文介绍了Android的NDK java.lang.UnsatisfiedLinkError中:findLibrary返回NULL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有在你的Andr​​oid应用JNI上面的错误?阅读...

Having the above error in your Android JNI app? Read on...

前面,我会说我已经解决了这一点,在我自己的方式,但我觉得在Android构建系统(也许是关于Eclipse)东西摔坏了,我希望能挽救的痛苦别人小时。也许其他人遇到这个问题,对他们有什么工作可以发表评论。

Up front, I'll say that I've already solved this, in my own way, but I feel something in the Android build system (perhaps regarding Eclipse) is broke, and I hope to save someone else hours of pain. Perhaps others have come across this issue and can comment on what worked for them.

有一段时间,我有一些JNI code,我使用NDK开发的Andr​​oid项目。那么,今天,我在java code改变的东西,然后噗,我再也无法载入我的JNI库。它没有像一个例外:

For a while, I've had an Android project with some JNI code that I developed using the NDK. Then, today, I changed something in the java code and then poof, I could no longer load my JNI library. It failed with an exception like:

E / AndroidRuntime(999):java.lang.UnsatisfiedLinkError中:无法加载在MyLibrary:findLibrary返回null

E/AndroidRuntime( 999): java.lang.UnsatisfiedLinkError: Couldn't load mylibrary: findLibrary returned null

我用Google搜索和尝试一切(重建,关闭并重新启动Eclipse的,等,等)

I googled and tried everything (rebuilding, close and relaunch Eclipse, etc, etc)

终于什么固定我的问题?我身体上卸载从设备上我的应用程序尝试另一个运行之前。而已。在此之后,它的工作。什么工作适合你?

What finally fixed my problem? I physically uninstalled my app from the device before trying another run. That's it. After that, it worked. What worked for you?

推荐答案

如果你想运行在一个模拟器您的应用程序,然后确保您指定在运行正确的体系结构 - >运行配置 - >目标(您可能需要使用窗口来添加所需的模拟 - > Android虚拟设备管理器)

If you are trying to run your app in a simulator, then make sure that you have specified the correct architecture in Run -> Run Configurations -> Target (you may need to add the required simulator using Window -> Android Virtual Device Manager).

我不得不尝试执行在英特尔仿真程序的时候,而应用程序是使用pcompiled为ARM库$ P $同样的问题。

I had the same problem when trying to execute an app in an Intel simulator, while the app was using a library precompiled for the ARM.

这篇关于Android的NDK java.lang.UnsatisfiedLinkError中:findLibrary返回NULL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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