您现在的位置是:首页 > 文章详情

Android--百度地图报错:at com.baidu.location.LocationClient.onStart(Unknown S...

日期:2017-04-12点击:590
版权声明:本文为博主原创文章,转载请标明出处。 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)

原文链接:https://yq.aliyun.com/articles/631522
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章