To integrate Baidu Map Navigation into one of my Android apps, I followed the implementation in the Baidu Map Navigation officail demo. However, my app fails at BaiduNaviManager.getInstance().init
. I checked Logcat and saw the exception pasted below:
10-29 17:56:12.793 13154 13154 W System.err: java.lang.reflect.InvocationTargetException
10-29 17:56:12.794 13154 13154 W System.err: at java.lang.reflect.Method.invoke(Native Method)
10-29 17:56:12.794 13154 13154 W System.err: at com.baidu.navisdk.adapter.base.BaiduNaviSDKProxy.init(BaiduNaviSDKProxy.java:128)
10-29 17:56:12.794 13154 13154 W System.err: at com.baidu.navisdk.adapter.BaiduNaviManager.init(BaiduNaviManager.java:237)
10-29 17:56:12.794 13154 13154 W System.err: at com.xxx.yyy.LocalMainActivity.initNavi(LocalMainActivity.java:768)
10-29 17:56:12.794 13154 13154 W System.err: at com.xxx.yyy.LocalMainActivity.onCreate(LocalMainActivity.java:216)
10-29 17:56:12.794 13154 13154 W System.err: at android.app.Activity.performCreate(Activity.java:6251)
10-29 17:56:12.794 13154 13154 W System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-29 17:56:12.794 13154 13154 W System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-29 17:56:12.794 13154 13154 W System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-29 17:56:12.794 13154 13154 W System.err: at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-29 17:56:12.794 13154 13154 W System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-29 17:56:12.794 13154 13154 W System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
10-29 17:56:12.794 13154 13154 W System.err: at android.os.Looper.loop(Looper.java:148)
10-29 17:56:12.794 13154 13154 W System.err: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-29 17:56:12.794 13154 13154 W System.err: at java.lang.reflect.Method.invoke(Native Method)
10-29 17:56:12.794 13154 13154 W System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-29 17:56:12.794 13154 13154 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-29 17:56:12.794 13154 13154 W System.err: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/user/0/com.xxx.yyy/lib/libcrypto.so" not found
10-29 17:56:12.795 13154 13154 W System.err: at java.lang.Runtime.load(Runtime.java:332)
10-29 17:56:12.795 13154 13154 W System.err: at java.lang.System.load(System.java:1069)
10-29 17:56:12.795 13154 13154 W System.err: at com.baidu.navisdk.adapter.impl.BaiduNaviManager.loadNativeLibrary(BaiduNaviManager.java:312)
10-29 17:56:12.797 13154 13154 W System.err: at com.baidu.navisdk.adapter.impl.BaiduNaviManager.loadBaiduNaviNativeLibrary(BaiduNaviManager.java:294)
10-29 17:56:12.797 13154 13154 W System.err: at com.baidu.navisdk.adapter.impl.BaiduNaviManager.init(BaiduNaviManager.java:694)
10-29 17:56:12.797 13154 13154 W System.err: at com.baidu.navisdk.adapter.impl.BaiduNaviSDKStub.init(BaiduNaviSDKStub.java:399)
I followed Baidu's instruction, downloaded the Baidu LBS Android SDK, and added them into the app. The complained libcrypto.so
is also in app\src\main\jniLibs\armeabi\
. Other Baidu Map SDK such as Geolocation/Map works fine in my app. Not sure what the root cause is here.
After I created a
armeabi-v7a
directory underjniLibs
and copied the same.so
files fromarmeabi
, the issue is gone.