我正在使用Google Maps API v2开发应用程序,我已经对它进行了测试,它非常适用于HTC Desire 500,三星Galaxy SIII mini和Mediacom Phonepad。但是在Nexus 5(使用Android Kitkat 4.4.2)上,当我点击打开“ActivityMap”的按钮时,我的应用程序崩溃了。 我还安装了Android的API 19。有人可以帮帮我吗?各种帮助将不胜感激。如果您需要我的代码,请问我。
03-18 11:21:37.240: E/AndroidRuntime(18406): FATAL EXCEPTION: main
03-18 11:21:37.240: E/AndroidRuntime(18406): Process: com.example.myapplication, PID: 18406
03-18 11:21:37.240: E/AndroidRuntime(18406): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MapActivity}: java.lang.NullPointerException
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.app.ActivityThread.access$800(ActivityThread.java:135)
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.os.Handler.dispatchMessage(Handler.java:102)
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.os.Looper.loop(Looper.java:136)
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.app.ActivityThread.main(ActivityThread.java:5017)
03-18 11:21:37.240: E/AndroidRuntime(18406): at java.lang.reflect.Method.invokeNative(Native Method)
03-18 11:21:37.240: E/AndroidRuntime(18406): at java.lang.reflect.Method.invoke(Method.java:515)
03-18 11:21:37.240: E/AndroidRuntime(18406): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-18 11:21:37.240: E/AndroidRuntime(18406): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-18 11:21:37.240: E/AndroidRuntime(18406): at dalvik.system.NativeStart.main(Native Method)
03-18 11:21:37.240: E/AndroidRuntime(18406): Caused by: java.lang.NullPointerException
03-18 11:21:37.240: E/AndroidRuntime(18406): at com.example.myapplication.MapActivity.onCreate(MapActivity.java:53)
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.app.Activity.performCreate(Activity.java:5231)
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
03-18 11:21:37.240: E/AndroidRuntime(18406): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
03-18 11:21:37.240: E/AndroidRuntime(18406): ... 11 more