的UnsatisfiedLinkError噩梦 [英] UnsatisfiedLinkError nightmare

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

问题描述

我知道这个问题已经问,但我没有发现任何方式寻求解决我的问题读取现有code。我的一些应用程序的用户对不同类型UnsatifiedLinkError的经验:

I know that this question is already asked but I've no found any way to find a solution to my issue reading the existing code. Some my application users have experience about different kind of UnsatifiedLinkError:


  1. 产生的原因:java.lang.UnsatisfiedLinkError中:无法加载MYLIB:findLibrary返回null

  2. 产生的原因:java.lang.UnsatisfiedLinkError中:库MYLIB没有找到

  3. 无法从装载机dalvik.system.PathClassLoader [dexPath = /系统/框架/ com.google.android.maps.jar加载MYLIB:
    /system/app/it.mycompany.myapp.apk,library

  4. java.lang.UnsatisfiedLinkError中:未找到本机方法:(此功能存在和它的实现)

我载入我的lib中使用code:System.oadLibrary(MYLIB);

I load my lib in the code using: System.oadLibrary("mylib");

我从来没有能够重现其中的任何。

I was never able to reproduce any of them.

请有你一些建议

推荐答案

请检查一下,如果可以的话,下的Andr​​oid版本的用户得到这些错误。这可能是例如,你的MYLIB取决于一些系统库,它采用的是Android的新版本中,但不是在旧的。我有这个例如当我做了我的本地库依赖AssetManager - 它不是的Andr​​oid 2.2Froyo的支持下的

Please check, if you can, under which versions of Android your users get these errors. It may be for example, that your "mylib" depends on some system library, which is found in newer versions of Android, but not on older ones. I had this e.g. when I made my native lib dependent on AssetManager - it was not supported under Android 2.2 "Froyo".

如果你在你的JNI文件夹,其中你建立你的本地库中添加一行像这样Application.mk:

If you add a line like this to Application.mk in your jni folder, where you build your native lib:

APP_PLATFORM:=机器人-8

APP_PLATFORM := android-8

应该构建过程中抛出错误,如果你使用的是根据API级别8不支持任何函数或类(Android 2.2的) - 或者根据需要调整水平

it should throw errors during build, if you are using any functions or classes not supported under API level 8 (Android 2.2) - or adjust the level as you need.

格雷格

这篇关于的UnsatisfiedLinkError噩梦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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