问题描述
- 百度地图开发,在5.0版本上运行,出现一下错误,低版本上运行是正常的。。。
-
04-23 15:09:24.229: D/AndroidRuntime(19314): Shutting down VM
04-23 15:09:24.229: E/AndroidRuntime(19314): FATAL EXCEPTION: main
04-23 15:09:24.229: E/AndroidRuntime(19314): Process: com.nbv.map.sdk, PID: 19314
04-23 15:09:24.229: E/AndroidRuntime(19314): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
04-23 15:09:24.229: E/AndroidRuntime(19314): at com.baidu.mapapi.map.PopupOverlay.showPopup(Unknown Source)
04-23 15:09:24.229: E/AndroidRuntime(19314): at com.baidu.mapapi.map.PopupOverlay.showPopup(Unknown Source)
04-23 15:09:24.229: E/AndroidRuntime(19314): at com.nbv.map.sdk.NbvMapOverlayDemo$7.onMapLongClick(NbvMapOverlayDemo.java:1110)
04-23 15:09:24.229: E/AndroidRuntime(19314): at com.baidu.mapapi.map.d.c(Unknown Source)
04-23 15:09:24.229: E/AndroidRuntime(19314): at com.baidu.platform.comapi.map.q.onLongPress(Unknown Source)
04-23 15:09:24.229: E/AndroidRuntime(19314): at android.view.GestureDetector.dispatchLongPress(GestureDetector.java:690)
04-23 15:09:24.229: E/AndroidRuntime(19314): at android.view.GestureDetector.access$200(GestureDetector.java:37)
04-23 15:09:24.229: E/AndroidRuntime(19314): at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:266)
04-23 15:09:24.229: E/AndroidRuntime(19314): at android.os.Handler.dispatchMessage(Handler.java:102)
04-23 15:09:24.229: E/AndroidRuntime(19314): at android.os.Looper.loop(Looper.java:135)
04-23 15:09:24.229: E/AndroidRuntime(19314): at android.app.ActivityThread.main(ActivityThread.java:5233)
04-23 15:09:24.229: E/AndroidRuntime(19314): at java.lang.reflect.Method.invoke(Native Method)
04-23 15:09:24.229: E/AndroidRuntime(19314): at java.lang.reflect.Method.invoke(Method.java:372)
04-23 15:09:24.229: E/AndroidRuntime(19314): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
04-23 15:09:24.229: E/AndroidRuntime(19314): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
解决方案
04-23 15:09:24.229: E/AndroidRuntime(19314): at android.view.GestureDetector.dispatchLongPress.... 线程堵了.
04-23 15:09:24.229: E/AndroidRuntime(19314): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
出现空指针, 赋一个初值
解决方案二:
NbvMapOverlayDemo.java 1110行 调用intValue()的对象未被实例化就用了,可以直接静态调用
解决方案三:
你查看一下你的lib下面的so文件是否拷贝完整了。
时间: 2024-10-11 00:20:22