Description of the question, please read this first
I am trying to get my simple application that will display the location of a user running on devices with Android 2.3 to Android 4.0+. The map does not appear on a real Android 2.3 device.
Currently, the application can run and display maps as I wanted on an Android 4.0+ device, without any problems.
Since it can display maps without any problems on Android 4.0+, therefore I believe that the problem should not be something wrong with the settings or permissions of Google Maps V2.
However, when I try to use it on Android 2.3 devices, the map area will be empty, as shown in the image below:

The application uses ActionBarSherlock, Google Maps API v2 and SupportMapFragment. The build targets SDK 17, min SDK 10.
Code snippet
I pasted and cut the code to show the only related part, please leave a comment if you need anything else.
activity_layout.xml
<fragment android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="@dimen/incident_padding_right" />
Activity.java
import com.actionbarsherlock.app.SherlockFragmentActivity; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.GoogleMap.OnMarkerDragListener; import com.google.android.gms.maps.SupportMapFragment; public class Activity extends SherlockFragmentActivity{ private static GoogleMap map; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.activity_layout); ............
Logcat when running on a real Android 2.3 device:
01-04 21:16:52.020: D/dalvikvm(19074): VFY: dead code 0x0014-0018 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b (Landroid/content/res/Resources;)Z 01-04 21:16:52.150: W/dalvikvm(19074): Unable to resolve superclass of Lmaps/p/s; (427) 01-04 21:16:52.150: W/dalvikvm(19074): Link of class 'Lmaps/p/s;' failed 01-04 21:16:52.150: W/dalvikvm(19074): Unable to resolve superclass of Lmaps/y/bo; (3820) 01-04 21:16:52.150: W/dalvikvm(19074): Link of class 'Lmaps/y/bo;' failed 01-04 21:16:52.150: W/dalvikvm(19074): Unable to resolve superclass of Lmaps/i/k; (4208) 01-04 21:16:52.150: W/dalvikvm(19074): Link of class 'Lmaps/i/k;' failed 01-04 21:16:52.150: E/dalvikvm(19074): Could not find class 'maps.i.k', referenced from method maps.z.ag.a 01-04 21:16:52.150: W/dalvikvm(19074): VFY: unable to resolve new-instance 3540 (Lmaps/i/k;) in Lmaps/z/ag; 01-04 21:16:52.150: D/dalvikvm(19074): VFY: replacing opcode 0x22 at 0x006d 01-04 21:16:52.160: D/dalvikvm(19074): VFY: dead code 0x006f-007f in Lmaps/z/ag;.a (Landroid/view/LayoutInflater;Lcom/google/android/gms/maps/GoogleMapOptions;ZLjava/lang/String;)Lmaps/z/ag;
Log code when running on emulator with Google API Lv.10
03-25 13:00:47.974: W/GooglePlayServicesUtil(751): Google Play services is missing. 03-25 13:00:47.992: W/GooglePlayServicesUtil(751): Google Play services is missing. 03-25 13:00:47.992: W/GooglePlayServicesUtil(751): Google Play services is missing. 03-25 13:00:48.002: W/GooglePlayServicesUtil(751): Google Play services is missing. 03-25 13:00:48.002: W/GooglePlayServicesUtil(751): Google Play services is missing. 03-25 13:00:48.022: W/GooglePlayServicesUtil(751): Google Play services is missing. 03-25 13:00:48.072: D/AndroidRuntime(751): Shutting down VM 03-25 13:00:48.072: W/dalvikvm(751): threadid=1: thread exiting with uncaught exception (group=0x40015560) 03-25 13:00:48.133: E/AndroidRuntime(751): FATAL EXCEPTION: main 03-25 13:00:48.133: E/AndroidRuntime(751): java.lang.RuntimeException: Unable to start activity ComponentInfo{Activity}: java.lang.NullPointerException 03-25 13:00:48.133: E/AndroidRuntime(751): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 03-25 13:00:48.133: E/AndroidRuntime(751): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 03-25 13:00:48.133: E/AndroidRuntime(751): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 03-25 13:00:48.133: E/AndroidRuntime(751): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 03-25 13:00:48.133: E/AndroidRuntime(751): at android.os.Handler.dispatchMessage(Handler.java:99) 03-25 13:00:48.133: E/AndroidRuntime(751): at android.os.Looper.loop(Looper.java:130) 03-25 13:00:48.133: E/AndroidRuntime(751): at android.app.ActivityThread.main(ActivityThread.java:3683) 03-25 13:00:48.133: E/AndroidRuntime(751): at java.lang.reflect.Method.invokeNative(Native Method) 03-25 13:00:48.133: E/AndroidRuntime(751): at java.lang.reflect.Method.invoke(Method.java:507) 03-25 13:00:48.133: E/AndroidRuntime(751): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-25 13:00:48.133: E/AndroidRuntime(751): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-25 13:00:48.133: E/AndroidRuntime(751): at dalvik.system.NativeStart.main(Native Method) 03-25 13:00:48.133: E/AndroidRuntime(751): Caused by: java.lang.NullPointerException 03-25 13:00:48.133: E/AndroidRuntime(751): at Activity.onCreate(Activity.java:250) 03-25 13:00:48.133: E/AndroidRuntime(751): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 03-25 13:00:48.133: E/AndroidRuntime(751): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 03-25 13:00:48.133: E/AndroidRuntime(751): ... 11 more
Activity.onCreate(Activity.java:250) pointed to this line:
map.setOnMarkerDragListener (markerDragListener);
What i tried
And it is strange that if I add this line
<uses-library android:name="com.google.android.maps" />
before AndroidManifest.xml , logcat will not show anything (without errors there is no warning), and the map is still empty. But someone has a message saying that this line solved the problem with an empty card: https://stackoverflow.com/questions/15595357/android-supportmapfragment-google-play-services-issue
In my Android Dependencies project folder Android Dependencies I have these *.jar :
actionbar-sherlock-4.2-library.jar google-play-services_lib.jar android-support-v4.jar actionbarsherlock-plugin-maps-4.2.0.jar google-play-services.jar
From the response of this post , I know that Google Maps may not work well on the emulator. All I need to do is display the map on a real Android 2.3 device, which I failed.
In addition, I also paid close attention to these messages and tried their method (if applicable to my circumstances), but still does not please my problem:
Google Map V2 Map Link
How to use the Google Maps API v2 with API level 10?
Google MapFragment is empty (white) with Could not find class 'maps.j.k'
Using ActionBarSherlock with the new SupportMapFragment
If you need more information, leave a comment below and I will try to add them.