-1

I am developing an app which uses Google Map. Everything is OK on emulator and the map works and shows the markers. But on real device it seems the fragment is not exist at all, there is no black screen or exception!

I know about the debug and release API keys and i am sure there is nothing wrong in this part. Both debug and release version of the app tested on real device but results were the same.

The following images are from the emulator and real device. Any advice would be helpful.

Emulator Device

Mbt925
  • 1,317
  • 1
  • 16
  • 31

2 Answers2

1

It's wired, you can try to change devices to have a another try. Mark sure you put the map fragment in XML something like following:

<fragment
        android:layout_width="match_parent"
        android:layout_height="400dp"
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.MapFragment" />

And initial map as follows:

// Initial Map
        try {

            if (googleMap == null) {
                googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

Also, you can the source code on my Github here. It includes a working map fragment on the real device.

enter image description here

bjiang
  • 6,068
  • 2
  • 22
  • 35
0

The problem was opengl es version. It was smaller than 2!

Mbt925
  • 1,317
  • 1
  • 16
  • 31