0
我已經創建了一個使用Google Maps API V2的應用程序。 我的應用程序已經在Sony XS和Galaxy Tab上運行,但無法在HTC Explorer(Android v 2.3.5)上運行。HTC Explorer中的谷歌地圖Android API V2中的錯誤
Min sdk在我的Manifest文件中是「8」。
我的日誌文件:
07-03 09:05:25.332: D/dalvikvm(2287): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp
07-03 09:05:25.332: W/dalvikvm(2287): VFY: unable to resolve instance field 28
07-03 09:05:25.332: D/dalvikvm(2287): VFY: replacing opcode 0x52 at 0x0012
07-03 09:05:25.332: D/dalvikvm(2287): VFY: dead code 0x0014-0018 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b (Landroid/content/res/Resources;)Z
07-03 09:05:25.352: W/GooglePlayServicesUtil(2287): Google Play services is missing.
07-03 09:05:25.352: W/GooglePlayServicesUtil(2287): Google Play services is missing.
07-03 09:05:25.362: W/GooglePlayServicesUtil(2287): Google Play services is missing.
07-03 09:05:25.362: W/GooglePlayServicesUtil(2287): Google Play services is missing.
07-03 09:05:25.362: W/GooglePlayServicesUtil(2287): Google Play services is missing.
07-03 09:05:25.392: W/GooglePlayServicesUtil(2287): Google Play services is missing.
07-03 09:05:25.432: D/WindowManagerImpl(2287): addView, new view, mViews[0]: [email protected]
07-03 09:05:25.442: D/AndroidRuntime(2287): Shutting down VM
07-03 09:05:25.442: W/dalvikvm(2287): threadid=1: thread exiting with uncaught exception (group=0x402445a0)
07-03 09:05:25.442: E/AndroidRuntime(2287): FATAL EXCEPTION: main
07-03 09:05:25.442: E/AndroidRuntime(2287): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.binhanh.fasttaxi/com.binhanh.fasttaxi.FastTaxiActivivty}: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized
07-03 09:05:25.442: E/AndroidRuntime(2287): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1872)
07-03 09:05:25.442: E/AndroidRuntime(2287): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1893)
07-03 09:05:25.442: E/AndroidRuntime(2287): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
07-03 09:05:25.442: E/AndroidRuntime(2287): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054)
07-03 09:05:25.442: E/AndroidRuntime(2287): at android.os.Handler.dispatchMessage(Handler.java:99)
07-03 09:05:25.442: E/AndroidRuntime(2287): at android.os.Looper.loop(Looper.java:150)
07-03 09:05:25.442: E/AndroidRuntime(2287): at android.app.ActivityThread.main(ActivityThread.java:4389)
07-03 09:05:25.442: E/AndroidRuntime(2287): at java.lang.reflect.Method.invokeNative(Native Method)
07-03 09:05:25.442: E/AndroidRuntime(2287): at java.lang.reflect.Method.invoke(Method.java:507)
07-03 09:05:25.442: E/AndroidRuntime(2287): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
07-03 09:05:25.442: E/AndroidRuntime(2287): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
07-03 09:05:25.442: E/AndroidRuntime(2287): at dalvik.system.NativeStart.main(Native Method)
07-03 09:05:25.442: E/AndroidRuntime(2287): Caused by: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized
07-03 09:05:25.442: E/AndroidRuntime(2287): at com.google.android.gms.internal.x.b(Unknown Source)
07-03 09:05:25.442: E/AndroidRuntime(2287): at com.google.android.gms.maps.model.BitmapDescriptorFactory.aW(Unknown Source)
07-03 09:05:25.442: E/AndroidRuntime(2287): at com.google.android.gms.maps.model.BitmapDescriptorFactory.fromResource(Unknown Source)
07-03 09:05:25.442: E/AndroidRuntime(2287): at com.binhanh.gmap.ManagerMap.<init>(ManagerMap.java:136)
07-03 09:05:25.442: E/AndroidRuntime(2287): at com.binhanh.fasttaxi.FastTaxiActivivty.onCreate(FastTaxiActivivty.java:54)
07-03 09:05:25.442: E/AndroidRuntime(2287): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
07-03 09:05:25.442: E/AndroidRuntime(2287): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1836)
07-03 09:05:25.442: E/AndroidRuntime(2287): ... 11 more
你在做整個isPlayServicesAvailable東西的地方嗎?如果沒有,你需要。從文檔「這取決於您在應用中選擇合適的位置,以執行以下步驟來檢查有效的Google Play服務APK。」 http://developer.android.com/google/play-services/setup.html。 –
我已經完成設置sdk(所以我的應用程序可以在其他設備上運行-Android V 4.x) –
您是否在您的fromResource調用之前嘗試過執行MapsInitializer.initialize(Context)? (如http://developer.android.com/reference/com/google/android/gms/maps/model/BitmapDescriptorFactory.html中所述) – ddewaele