0

我在我的 goole 游戏控制台上收到了这个崩溃报告:

  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# 编写。我怎样才能发现我的问题是什么?

4

2 回答 2

0

您的问题似乎是您正在混合使用 Maps API v2 和已弃用的 v1。com.google.android.maps.MapView 是旧 API 中的一个类。

于 2013-07-11T09:54:18.757 回答
0

请参阅崩溃报告的第一行:java.lang.NullPointerException

一种方法因异常而中断,因此某些全局变量未实例化并保留null。所以应用程序导致崩溃。

于 2013-08-04T22:17:43.570 回答