Bmob初始化找不到.so库问题

将app安装到手机普通应用没有问题,push到Android6.0系统app里面启动出现如下报错:
3757-3757/com.example.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.myapplication, PID: 3757
java.lang.UnsatisfiedLinkError: No implementation found for boolean cn.bmob.v3.helper.BmobNative.init(android.content.Context, java.lang.String) (tried Java_cn_bmob_v3_helper_BmobNative_init and Java_cn_bmob_v3_helper_BmobNative_init__Landroid_content_Context_2Ljava_lang_String_2)
at cn.bmob.v3.helper.BmobNative.init(Native Method)
at cn.bmob.v3.BmobWrapper.(BmobWrapper.java:92)
at cn.bmob.v3.BmobWrapper.V(BmobWrapper.java:74)
at cn.bmob.v3.BmobWrapper.Code(BmobWrapper.java:62)
at cn.bmob.v3.Bmob.Code(Bmob.java:63)
at cn.bmob.v3.Bmob.initialize(Bmob.java:40)
at com.example.myapplication.MyApp.onCreate(MyApp.java:14)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1018)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4970)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread H . h a n d l e M e s s a g e ( A c t i v i t y T h r e a d . j a v a : 1560 ) a t a n d r o i d . o s . H a n d l e r . d i s p a t c h M e s s a g e ( H a n d l e r . j a v a : 111 ) a t a n d r o i d . o s . L o o p e r . l o o p ( L o o p e r . j a v a : 207 ) a t a n d r o i d . a p p . A c t i v i t y T h r e a d . m a i n ( A c t i v i t y T h r e a d . j a v a : 5765 ) a t j a v a . l a n g . r e f l e c t . M e t h o d . i n v o k e ( N a t i v e M e t h o d ) a t c o m . a n d r o i d . i n t e r n a l . o s . Z y g o t e I n i t H.handleMessage(ActivityThread.java:1560) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5765) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit H.handleMessage(ActivityThread.java:1560)atandroid.os.Handler.dispatchMessage(Handler.java:111)atandroid.os.Looper.loop(Looper.java:207)atandroid.app.ActivityThread.main(ActivityThread.java:5765)atjava.lang.reflect.Method.invoke(NativeMethod)atcom.android.internal.os.ZygoteInitMethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
一开始还以为是Android6.0兼容问题,结果不是。
将APK直接放入系统目录中,会导致APK找不到so文件,正常情况下的安装是使用PackageManager,它会将so文件拷入系统读取的so文件夹目录下,提供给App使用;系统应用就是不会使用PackageManager去安装,所以在使用系统应用前,把apk中lib文件夹下的所有*.so文件(不含任何目录)复制到/system/lib/文件夹下就可以了,注意是32位还是64位。
感谢https://blog.csdn.net/pmtoam/article/details/42104365以及https://yq.aliyun.com/articles/660686

你可能感兴趣的:(Android)