版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/chaoyu168/article/details/70159731
在使用百度地图定位的时候,报一个异常
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)
解决办法:首先检查libs下是否缺少支持的.so文件,(我的已经存在)
继续检查,发现new LocationClient 这个的时候 需要用 getApplicationContext。
问题解决。(用全局变量context)