关于百度地图 java.lang.NoSuchMethodError: com.baidu.location.BDLocation.getAddress



异常信息:


<span style="font-size:18px;">02-25 08:26:27.010: E/dalvikvm(22768): Could not find class 'com.baidu.location.Address$Builder', referenced from method com.baidu.serverLoc.b.f.new
02-25 08:26:27.010: W/dalvikvm(22768): VFY: unable to resolve new-instance 86 (Lcom/baidu/location/Address$Builder;) in Lcom/baidu/serverLoc/b/f;
02-25 08:26:27.010: D/dalvikvm(22768): VFY: replacing opcode 0x22 at 0x016f
02-25 08:26:27.020: D/dalvikvm(22768): DexOpt: unable to opt direct call 0x00ce at 0x171 in Lcom/baidu/serverLoc/b/f;.new
02-25 08:26:27.020: I/dalvikvm(22768): Could not find method android.content.Context.getExternalFilesDirs, referenced from method com.baidu.serverLoc.a.e.int
02-25 08:26:27.030: W/dalvikvm(22768): VFY: unable to resolve virtual method 12: Landroid/content/Context;.getExternalFilesDirs (Ljava/lang/String;)
[Ljava/io/File;
02-25 08:26:27.030: D/dalvikvm(22768): VFY: replacing opcode 0x6e at 0x005b
02-25 08:26:27.090: D/dalvikvm(22768): GC_CONCURRENT freed 288K, 12% free 2664K/3024K, paused 3ms+1ms, total 14ms
02-25 08:26:27.150: W/dalvikvm(22768): threadid=12: thread exiting with uncaught exception (group=0x41743930)
02-25 08:26:27.150: E/AndroidRuntime(22768): FATAL EXCEPTION: ServiceStartArguments
02-25 08:26:27.150: E/AndroidRuntime(22768): java.lang.NoSuchMethodError: com.baidu.location.BDLocation.getAddress
02-25 08:26:27.150: E/AndroidRuntime(22768):  at com.baidu.serverLoc.c.m.try(Unknown Source)
02-25 08:26:27.150: E/AndroidRuntime(22768):  at com.baidu.serverLoc.c.c$b.handleMessage(Unknown Source)
02-25 08:26:27.150: E/AndroidRuntime(22768):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-25 08:26:27.150: E/AndroidRuntime(22768):  at android.os.Looper.loop(Looper.java:137)
02-25 08:26:27.150: E/AndroidRuntime(22768):  at android.os.HandlerThread.run(HandlerThread.java:60)
02-25 08:26:37.390: I/Process(22768): Sending signal. PID: 22768 SIG: 9
</span>



错误原因:此应用中只开发定位功能,引用了BaiduLBS_Android.jar  而不是引用locSDK_6.05.jar    引用的库文件为liblocSDK6.so  而不是  liblocSDK6a.so引起的

出现在问题的原因是下载的官网开发包并参考官网开发流程的代码进行开发引起的错误,应该下载官网示例代码,在实例代码运行正常的情况下,对实例代码和jar进行copy




定位: http://developer.baidu.com/map/index.php?title=android-locsdk/geosdk-android-download




地图: http://developer.baidu.com/map/index.php?title=androidsdk/sdkandev-download

你可能感兴趣的:(关于百度地图 java.lang.NoSuchMethodError: com.baidu.location.BDLocation.getAddress)