问题
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