[android]百度定位sdk报错

时间:2022-09-04 10:50:21

具体报错信息如下:

Exception Ljava/lang/UnsatisfiedLinkError; 
threadid=1: thread exiting with uncaught exception (group=0x410d19d8)

FATAL EXCEPTION: main

java.lang.ExceptionInInitializerError
at com.baidu.location.g.a(Unknown Source)
at com.baidu.location.f.int(Unknown Source)
at com.baidu.location.f.int(Unknown Source)
at com.baidu.location.f.if(Unknown Source)

at com.baidu.location.f$b.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4439)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)

at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load locSDK_2.4: findLibrary returned null

at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at com.baidu.location.Jni.<clinit>(Unknown Source)


请注意错误信息中的这个:Caused by: java.lang.UnsatisfiedLinkError: Couldn't load locSDK_2.4: findLibrary returned null原因就在这里,没有找到locSDK_2.4.so文件

将demo中的libs/armeabi/liblocSDK_2.4.so文件copy到工程的libs文件夹内,如果不存在该文件夹,请自行新建


欢迎交流android开发