No implementation found for int com.baidu.mapsdkplatform.comjni.tools.JNITools.initClass(java.lang.O

今天又有一个历史项目需要维护,发现百度地图只显示网格,没有图像出来。感觉可能是签名问题,但是下载来的代码中只有那一个签名,所以干脆把百度地图的东西都替换掉;
替换完一运行,直接崩溃了:

E/NativeLoader: found libBaiduMapSDK_base_v4_2_0.so error
E/art: No implementation found for int com.baidu.platform.comjni.tools.JNITools.initClass(java.lang.Object, int) (tried Java_com_baidu_platform_comjni_tools_JNITools_initClass and Java_com_baidu_platform_comjni_tools_JNITools_initClass__Ljava_lang_Object_2I)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: cn.hjtechcn.maintenance, PID: 30487
    java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.platform.comjni.tools.JNITools.initClass(java.lang.Object, int) (tried Java_com_baidu_platform_comjni_tools_JNITools_initClass and Java_com_baidu_platform_comjni_tools_JNITools_initClass__Ljava_lang_Object_2I)
        at com.baidu.platform.comjni.tools.JNITools.initClass(Native Method)
        at com.baidu.platform.comjni.tools.a.b(Unknown Source)
        at com.baidu.platform.comapi.a.(Unknown Source)
        at com.baidu.platform.comapi.a.a(Unknown Source)
        at com.baidu.platform.comapi.c.a(Unknown Source)
        at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source)
        at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source)
        at cn.hjtechcn.maintenance.application.RabbitApplication.onCreate(RabbitApplication.java:32)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4912)
        at android.app.ActivityThread.access$1600(ActivityThread.java:181)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1566)
        at android.os.Handler.dispatchMessage(Handler.java:111)
        at android.os.Looper.loop(Looper.java:210)
        at android.app.ActivityThread.main(ActivityThread.java:5711)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:967)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

惊了!感觉自己的操作没毛病啊,百度一下都是说要加这个

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }

仔细想了一下,这个是把百度地图的.so文件放到libs下才需要加这个,我是直接放到jniLibs下的,所以不需要加这个。

一番百度,说可能是.so包可能有问题,把之前写的项目找出来对比了一下
No implementation found for int com.baidu.mapsdkplatform.comjni.tools.JNITools.initClass(java.lang.O_第1张图片

从百度新下载的.so文件怎么多了好几个,删掉试一下,果然好了 No implementation found for int com.baidu.mapsdkplatform.comjni.tools.JNITools.initClass(java.lang.O_第2张图片

参考资料:
https://blog.csdn.net/CrazyRango/article/details/71374734

你可能感兴趣的:(api)