我在谷歌播放控制台上收到了这个崩溃报告:
java.lang.NullPointerException
at com.google.android.maps.PixelConverter.toPixels(PixelConverter.java:71)
at com.google.android.maps.PixelConverter.toPixels(PixelConverter.java:61)
at com.google.android.maps.MapView.onLayout(MapView.java:727)
at android.view.View.layout(View.java:14459)
at android.view.ViewGroup.layout(ViewGroup.java:4469)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1669)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1527)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
at android.view.View.layout(View.java:14459)
at android.view.ViewGroup.layout(ViewGroup.java:4469)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14459)
at android.view.ViewGroup.layout(ViewGroup.java:4469)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1669)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1527)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
at android.view.View.layout(View.java:14459)
at android.view.ViewGroup.layout(ViewGroup.java:4469)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14459)
at android.view.ViewGroup.layout(ViewGroup.java:4469)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2132)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1951)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1164)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4845)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
at android.view.Choreographer.doCallbacks(Choreographer.java:562)
at android.view.Choreographer.doFrame(Choreographer.java:532)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5264)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
这是一个java堆栈跟踪,我的代码在monodroid和c#上。我怎样才能发现我的问题是什么?
答案 0 :(得分:0)
您的问题似乎是您正在混合使用Maps API v2并弃用v1。 com.google.android.maps.MapView是旧API的一个类。
答案 1 :(得分:0)
请参阅崩溃报告的第一行:java.lang.NullPointerException
一个方法因异常而中断,因此一些全局变量未实例化并保持null
。因此应用程序导致崩溃。