Native crash (UnsatisfiedLinkError) when the application is updated

允我心安 提交于 2020-01-15 09:36:08

问题


I have an app that uses some native code. The applications works fine and contains all the abis but in some android devices like Galaxy Note5 with Android 7.0 and SM-G955U (Samsung Galaxy S8 plus) with Android 7.0 the application crashes with the following error:

Fatal Exception: java.lang.UnsatisfiedLinkError: Native method not found

These are the abis included in the APK:

arm64-v8a
armeabi
armeabi-v7a
mips
mips64
x86
x86_64

Anybody knows how can I fix that?

Thanks!


回答1:


Looks like this is a problem related to some Android versions and also to the package manager.

The solution for me was to use the ReLinker library. The following article gives a good description to this issue and how to solve it:

https://medium.com/keepsafe-engineering/the-perils-of-loading-native-libraries-on-android-befa49dce2db




回答2:


If your problem only exists on devices with API >= 23, you can set application/extractNativeLibs to false in your Manifest, and the native libraries will be used without unpacking. This can also reduce disk requirements for your app.



来源:https://stackoverflow.com/questions/47098064/native-crash-unsatisfiedlinkerror-when-the-application-is-updated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!