0

I'm currently developing an application that integrate with google map. However it didn't run as I expect to be. It shows nothing, just a blank gray screen.

I've checked my adb and grep Auth there doesn't seems any mistake in authorization. Which means it's eliminate the possibility of mistake API_KEY.

I wonder what's the possibilities that I didn't see. I hope to find some insights here..

My Manifest

<uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>
 <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="[Removed]"/>

My Gradle

compile 'com.google.android.gms:play-services:7.8.0'

My fragment XML

<com.google.android.gms.maps.MapView
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

My Fragment

public class CurrentLocationFragment extends Fragment implements OnMapReadyCallback {

private MapView mapView;
private GoogleMap map;

@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_current_location, null);
        FragmentManager fm = getChildFragmentManager();
        mapView = (MapView) view.findViewById(R.id.map);
        mapView.onCreate(savedInstanceState);

        map = mapView.getMap();
        map.getUiSettings().setMyLocationButtonEnabled(false);
        map.setMyLocationEnabled(true);

        //initialize the map
        try {
            MapsInitializer.initialize(this.getActivity());
        } catch (Throwable e) {
            e.printStackTrace();
        }

        //animate the camera
        CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(43.1, -87.9), 10);
        map.animateCamera(cameraUpdate);

        return view;

    }

Any Insights will be much appriciated! Thanks..

izariel
  • 23
  • 4

1 Answers1

0

Are you using Android Studio? You can create a Map App by default and is too easy, later you can change the MainActivity and put like Second or Third Activity,

Follow this steps to create your app HERE

josedlujan
  • 5,357
  • 2
  • 27
  • 49
  • I've checked and it's the same. Logcat finally shows to me that there is a mismatch between my SH1 fingerprints in 'console.google.com' with my debug.keystore. – izariel Sep 04 '15 at 01:16