I have implemented google map in my app.But its display only blank grids.I have done changes in AndroidManifest.xml file and also included API key in layout file of map acti
The problem is the code API. Use the following function to see if the Key Google Maps is correct:
private String getShaKey() {
//fucnion para saber si esta bien registrado el codigo de googlemaps
//ME SALE EXCEPTION DE NOMBRE NO ENCONTRADO?¿?¿
String strRet="";
try {
PackageInfo info = getPackageManager().getPackageInfo("your.package.name",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
//Log.v(TAG, "KeyHash:" + Base64.encodeToString(md.digest(),
strRet="KeyHash:" + Base64.encodeToString(md.digest(),Base64.DEFAULT);
}
} catch (NameNotFoundException e) {
//e.printStackTrace();
strRet="EXCEPTION NOMBRE NO ENCONTRADO";
} catch (NoSuchAlgorithmException e) {
//e.printStackTrace();
strRet="EXCEPTION ALGORITMO NO";
}
return strRet;
}
I was having the same problems until I realised that in the API console I had enabled
Google Maps API v2
and not the
Google Maps Android API v2
Once I enabled it everything was fine.
This happens to me also. On the first time I successfully launched the Google maps, in works fine, on the second day, the entire map(default view) is rendered only in half while the other half are filled with tiles only, after changing some properties in the map, it all went to tiles only.
Now, what I did is I renew my API key and everything went fine.
I had the same problem. I added this line on the Manifest.xml and everything is working fine now :
<uses-library android:name="com.google.android.maps" />
This may sound silly, but I kept encountering this problem until I realized that the <uses-permission>
tags need to be direct children to the <manifest>
element, rather than the <application>
element. I had erroneously been putting them right after the <uses-library>
tag. So the final structure of your AndroidManifest.xml file should be something like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
<uses-sdk ... />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<application ... >
<activity ... >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps" />
</application>
</manifest>
Hope this helps anyone who was making the same mistake!