我在Android應用程序中添加了GoogleMap v2。在正常使用中,我沒有問題。 但是,如果我重置手機並安裝我的應用程序,地圖崩潰。谷歌地圖v2崩潰,如果首次使用Android
報告:
Caused by: java.lang.NullPointerException: CameraUpdateFactory is not initialized
當我更新谷歌的服務,這個bug消失。
任何人都會有一個軌跡,或強制用戶在使用應用程序之前更新Google服務的方法?
感謝
例外:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.app/com.test.app.activity.AcHome}: java.lang.NullPointerException: CameraUpdateFactory is not initialized
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2067)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092)
at android.app.ActivityThread.access$600(ActivityThread.java:133)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4794)
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:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException: CameraUpdateFactory is not initialized
at com.google.android.gms.internal.s.b(Unknown Source)
at com.google.android.gms.maps.CameraUpdateFactory.aX(Unknown Source)
at com.google.android.gms.maps.CameraUpdateFactory.newLatLngZoom(Unknown Source)
at com.test.app.activity.AcHome.onCreate(AcHome.java:126)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2031)
... 11 more
發佈您的所有logcat。 –
和你的代碼... –
你可以看看我的幫手庫在github上:https://github.com/yayaa/MapHelper – yahya