间歇性的Andr​​oid NDK的UnsatisfiedLinkError [英] Intermittent Android NDK UnsatisfiedLinkError

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

问题描述

我已经越来越零散,难以再现UnsatisfiedLinkErrors,最常见的当我的应用程序已暂停了很长的时间(即小时)。在JNI调用正常工作,出现这些错误。

I have been getting sporadic, difficult to reproduce UnsatisfiedLinkErrors, most commonly when my application has been paused for a long time (i.e., hours). These errors occur on JNI calls that normally work.

Android版是否卸载有时库没有完全关闭的应用程序?我打开我的家乡库一个活动还能用它在另一个活动。难道要的Andr​​oid是摧毁加载库活动和卸载它,然后失败时使用它的其他活动恢复到重装库?

Does Android sometimes unload a library without completely closing an application? I load my native library in one activity but also use it in another activity. Could Android be destroying the activity that loaded the library and unloading it, then failing to reload the library when the other activity that uses it is resumed?

推荐答案

每当您加载一个库,像这样的活动,

Everytime you load a library with an Activity like this,

   static {
        System.loadLibrary("gamescript");
    }       

然后该库活动类似一个局部静态构件内装入并不会被卸载,直至该应用是活的。然而,我的疑问是,如果这将是从类的外部访问。

Then the library is loaded within the Activity class like a local static member and will not be unloaded until the app is alive. However, my doubt is if it will be accessible from outside the class.

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

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