android - 使用百度sdk調用SDKInitializer.initialize(this)時報錯?
問題描述
07-24 14:45:59.525 27354-27354/com.xinguan14.jdyp E/NativeLoader: found libBaiduMapSDK_base_v4_0_0.so error07-24 14:45:59.527 27354-27354/com.xinguan14.jdyp E/art: No implementation found for int com.baidu.platform.comjni.engine.JNIEngine.initClass(java.lang.Object, int) (tried Java_com_baidu_platform_comjni_engine_JNIEngine_initClass and Java_com_baidu_platform_comjni_engine_JNIEngine_initClass__Ljava_lang_Object_2I)07-24 14:45:59.527 27354-27354/com.xinguan14.jdyp D/AndroidRuntime: Shutting down VM--------- beginning of crash07-24 14:45:59.528 27354-27354/com.xinguan14.jdyp E/AndroidRuntime: FATAL EXCEPTION: mainProcess: com.xinguan14.jdyp, PID: 27354java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.platform.comjni.engine.JNIEngine.initClass(java.lang.Object, int) (tried Java_com_baidu_platform_comjni_engine_JNIEngine_initClass and Java_com_baidu_platform_comjni_engine_JNIEngine_initClass__Ljava_lang_Object_2I) at com.baidu.platform.comjni.engine.JNIEngine.initClass(Native Method) at com.baidu.platform.comjni.engine.AppEngine.InitClass(Unknown Source) at com.baidu.platform.comapi.a.<clinit>(Unknown Source) at com.baidu.platform.comapi.b.a(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source) at com.xinguan14.jdyp.MyApplication.initBaidu(MyApplication.java:146) at com.xinguan14.jdyp.MyApplication.onCreate(MyApplication.java:60) at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:369) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4726) at android.app.ActivityThread.access$1600(ActivityThread.java:153) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5438) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)07-24 14:45:59.537 27354-27354/com.xinguan14.jdyp I/Process: Sending signal. PID: 27354 SIG: 907-24 14:46:09.949 27512-27564/com.xinguan14.jdyp W/System: ClassLoader referenced unknown path: /system/framework/tcmclient.jar07-24 14:46:10.150 27544-27544/com.xinguan14.jdyp:bmobcore E/NativeLoader: found libBaiduMapSDK_base_v4_0_0.so error07-24 14:46:10.152 27544-27544/com.xinguan14.jdyp:bmobcore E/art: No implementation found for int com.baidu.platform.comjni.engine.JNIEngine.initClass(java.lang.Object, int) (tried Java_com_baidu_platform_comjni_engine_JNIEngine_initClass and Java_com_baidu_platform_comjni_engine_JNIEngine_initClass__Ljava_lang_Object_2I)07-24 14:46:10.152 27544-27544/com.xinguan14.jdyp:bmobcore D/AndroidRuntime: Shutting down VM07-24 14:46:10.153 27544-27544/com.xinguan14.jdyp:bmobcore E/AndroidRuntime: FATAL EXCEPTION: main Process: com.xinguan14.jdyp:bmobcore, PID: 27544 java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.platform.comjni.engine.JNIEngine.initClass(java.lang.Object, int) (tried Java_com_baidu_platform_comjni_engine_JNIEngine_initClass and Java_com_baidu_platform_comjni_engine_JNIEngine_initClass__Ljava_lang_Object_2I) at com.baidu.platform.comjni.engine.JNIEngine.initClass(Native Method) at com.baidu.platform.comjni.engine.AppEngine.InitClass(Unknown Source) at com.baidu.platform.comapi.a.<clinit>(Unknown Source) at com.baidu.platform.comapi.b.a(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source) at com.xinguan14.jdyp.MyApplication.initBaidu(MyApplication.java:146) at com.xinguan14.jdyp.MyApplication.onCreate(MyApplication.java:60) at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:369) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4726) at android.app.ActivityThread.access$1600(ActivityThread.java:153) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5438) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
問題解答
回答1:已經解決了。so文件的位置問題
回答2:.so文件的問題,下載最新百度sdk,在main下新建jniLibs文件夾,復制到里面
回答3:估計是你庫沒有導入完整,看看你的.so文件是不是都導入了
回答4:看報錯應該是你的.so文件的問題,有可能你使用的是模擬器,建議使用真機調試。
回答5:07-24 14:45:59.525 27354-27354/com.xinguan14.jdyp E/NativeLoader: found libBaiduMapSDK_base_v4_0_0.so error
so庫沒有正確導入吧?或者so庫跟jar包的版本不對應。
關于android studio導入so庫的方法,請看方法5 http://blog.csdn.net/yy1300326388/article/details/46422939回答6:
把jar包全放在libs目錄而不是lib目錄,多搞幾下又好了。
相關文章:
1. 運行python程序時出現“應用程序發生異常”的內存錯誤?2. macos - 無法source activate python273. css3 讓圖片變成灰色(filter),但針對IE11瀏覽器無效4. java - butterknife怎么綁定多個view5. java - 同步/異步與阻塞/非阻塞之間的差異具體是什么?6. android - Genymotion 模擬器可以做屏幕適配檢測嗎?7. html5 - 前端面試碰到了一個緩存數據的問題,來論壇上請教一下8. javascript - 打算寫一個c++的node圖像處理模塊,有沒有推薦的c++圖片處理庫?9. html - vue里面:src在IE(9-11)下不顯示圖片10. 我在導入模板資源時遇到無法顯示的問題,請老師解答下

網公網安備