Google Maps Android API fails to load map - android

I know there are many questions like this, but I've verified that everything is set up correctly. The worst part is that it worked perfectly fine until I reinstalled Windows. (I did update it with the newly generated debug key).
Debug keystore
Google API console
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="nl.whileio.ovaub" android:versionCode="1" android:versionName="1.0">
<!-- Android 4.0+, almost entire target market nowadays and native action bar is convenient -->
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="19" />
<!-- Internet and GPS -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Google Maps requires these -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- OpenGL ES 2.0 required to render maps -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<application android:allowBackup="true" android:icon="#drawable/ic_launcher" android:logo="#drawable/ic_logo" android:label="#string/app_name" android:theme="#style/AppTheme">
<!-- Google Play services -->
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<!-- Google Maps API key -->
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyD1xkO8zpfyWP52qqt6cuxnWPU5eOfxZVM" />
<!-- Main side bar + fragments activity -->
<activity android:name="nl.whileio.ovaub.view.MainActivity" android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Logcat
This appears right away:
And this appears about 20 seconds after the app has started:
That almost makes it look like there are actual network problems. The Google Maps application and other apps load maps fine, however.
What I have tried:
Regenerate API key in API console a few times
Uninstall and reinstall app after every single change
Ran Project -> Clean -> Clean all projects a couple of dozen times
Tried the maps API sample with appropriate key and package, made no difference
Tried signing with a real keystore, also made no difference
Verified with keytool that the installed APK (cert.rsa) really does use the correct debug keystore, which it does
Restarted my phone
Any ideas what I can do at this point?

I created a completely new project in the Google API console, which seems to have solved the problem.

i suggest you came to visit here to download a sample code of hello map Android from Google it self, then you can follow the tutorial in there, i have a same problem with you, but when i find this the link i gave you, now it's working.. i hope it can help you
Please Read Carefully the tutorial, i'm sure it's working :D

Related

Google map not loading Android

Though I know this has been a persistent and addressed issue, everyone's problem seems to be solved a different way every time. I have been trying to get my map to show all day but to no avail. I had a project which had a map in it, so what I migrated that project to another location and set up Google Play Services in that project. I got everything to work except for the map to show. I have the library as i am able to use LatLng but the map always fails to load. I have generated new keys, deleted and re added the key, and deleted and re added the debug keystore. I have also updated the api console to ensure everything lined up but my map still doesnt show. I have Google Map for Android Api enabled in the console. And my package name is correct also. I have ran a clean rebuild and uninstalled the app to see if it works but it still doesnt load.
NOTE: I have also tried using SupportMapFragment instead.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.wallfly"
android:largeHeap="true">
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.Actionbarstyle">
<activity
android:name="com.android.wallfly.MyActivity"
android:label="#string/app_name" >
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="(Actual API Key)" />
</application>
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<permission
android:name="com.android.wallfly.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.android.wallfly.permission.MAPS_RECEIVE"/>
<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.WRITE_SETTINGS" />
<!-- these grant the app the ability to access location. coarse is wifi and cellular, fine is gps -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
I have added an image to show that my package name lines up. Also i copied and pasted the SHA1 fingerprint so I am sure that it does line up also.
For those who may face a similar problem, my google play service was outdated. So I had to change the build.gradle the current version of google play service.

Google Maps APIv2 Authentication failure

The error:
08-15 12:59:17.435: E/Google Maps Android API(14665): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
The Google Console:
The manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cefetmgrdctcc.sgtp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<permission
android:name="com.cefetmgrdctcc.sgtp.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.cefetmgrdctcc.sgtp.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<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_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="Hidden key"/>
<activity
android:name="com.cefetmgrdctcc.sgtp.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The layout of the map control:
<fragment
android:id="#+id/googlemap"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
I've imported the Google Play Services into my project and marked on the Google API Console Services list "Google Maps API v2", "Google Maps API v3" and "Google Maps Android API v2", however it seems my Map Fragment is still not being able to authenticate.
Map Fragment is just a blank grey square on the middle of the screen, any ideas why is this happening?
Hi I was just having this exact same problem. I tried everything the docs said but nothing seemed to work.
The only thing that worked for me was uninstalling and reinstalling my application (not even rebooting worked) because apparently if you make one mistake on the configuration the system caches the failed authentication and your maps won't work even after fixing your configuration.
So try following the docs and guides on configuring Google Maps Api on Android but every time you change something on your configuration uninstall and reinstall.
If you are running application on a device,experiencing the same issue and had no luck any other solutions.
make sure the installed google-play services is the latest one.
make sure the device date and time is correct as well
http://www.techkhoji.com/no-connection-retry-google-play-store/
Google Play Services sync with their master servers to send and
receive data, to do this your device time and date should be correctly
set
Check if other applications depend on google-play services such as Play Store are working.If they are having trouble with connecting to servers ("NO CONNECTION, RETRY") even when the internet connection is available one of the above points could be the solution.
I regenerated API key and updated in google console, its working fine

Using Google Maps v2 in Android

i am trying to integrate Google Maps to my Android Application. I followed this tutorial: https://blog-emildesign.rhcloud.com/?p=435.
I did everything as suggested.
These are the errors in the error log:
E/Google Maps Android API(28238): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
E/Google Maps Android API(28238): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
E/Google Maps Android API(28238): Ensure that the following correspond to what is in the API Console: Package Name: com.example.kontrollen, API Key: xxxxxxxxxxxxxx, Certificate Fingerprint: xxxxxxxxxxxxxxxxxxxxxxx
And this is my google account:
Do you have any ideas what i can do?
This is my AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.kontrollen"
android:versionCode="1"
android:versionName="1.0" >
<permission android:name="com.example.kontrollen.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.example.kontrollen.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET" />
<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_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxx" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.kontrollen.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I solved the problem by uninstalling the app and cleaning the project folder. I did not change anything. Thank you for your help.
follow the url to create your app google api key i have done this recently.. and it was successful.
https://code.google.com/apis/console/ ------------ For Google API
https://developers.google.com/maps/documentation/android/start ------------ Crate Map
read these page carefully every thing is given in this page .. follow the same but make sure you have generated correct SHA1 fingerprint
and when you are going to crate the app make sure run it on real device because it need google play services to run add google pay services in your application
Edited answer:
Try putting the meta-data within the application tag, preferably right before the closing tag like
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xyz" />
</application>
Follow this steps to trace error youself
STEPS
for your error type
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
1.check for internet or gsf reader permissions in manifest as shown above.
2.check for the package name you used in you manifest.
3.check in your api console the service that you started is Google Maps Android API v2.
4.Check the library google play services is imported or not.
5.if no solution is working try out new way following this link-- https://developers.google.com/maps/documentation/android/start.
6.Also keytool command to generate sha1--i used is-
keytool -v -list -alias androiddebugkey -keystore C:/Users/username/.android/debug.keystore
I had actually made a maps activity from the studio and used the link it generated to set up the maps API. Where I went wrong was, I placed it inside a package and the package name that was registered for the app was with that folder name. For Ex.
If app package name is
com.awesome.shit
the package that was saved in API was
com.awesome.shit.maps
changed it and it started working.

Google Maps Android V2 - Blank Screen

I am implementing google maps for android. I created a test application and inserted all the permissions etc in that application and the application worked flawlessly.
But when I try and copy the same code to my real application it shows me blank screen on the android activity.Although I've updated the package name in the google api console.
Here's what my Test Project Manifest Looks Like :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapstutorial"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<permission
android:name="com.example.mapstutorial.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapstutorial.permission.MAPS_RECEIVE"/>
<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-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my api key"/>
<activity
android:name="com.example.mapstutorial.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
and here's what my real project manifest looks like :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.shop.shoppinglist"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<permission android:name="com.shop.addtask.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<permission android:name="com.shop.shoppinglist.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<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="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.shop.addtask.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.shop.shoppinglist.permission.C2D_MESSAGE" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:allowBackup="true"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my api key"/>
<activity
android:name=".Login_Activity"
android:label="#string/title_activity_main"
android:theme="#style/Theme.Sherlock"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I updated the package name to com.shop.addtask in my console fingerprint but still it shows me the white screen.What could cause the problem ? The apikey I've used is same in both of the applications. But it works on test application not on the real app.
I've created the api key using the fingerprint
I've switched on google maps android v2 in the console
I am using the same api key as mentioned in the console.
So these things are correct and the problem cannot be caused by one of them.
2 possible reasons:
1. this part:
<uses-library android:name="com.google.android.maps"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my api key"/>
should right before the closing application tag.
2. Most likely you have some sort of problem with your key. Try to generate a new by deleting the debug.keystore folder and running a project. then register it again via the console.
you can use this guide I wrote to do just that:
Google Map API V2 key
Update:
Check this for a second:
<permission android:name="com.shop.addtask.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
it looks that the package you set here is not the package of your application and should be:
<uses-permission android:name="com.shop.shoppinglist.permission.MAPS_RECEIVE"/>
<permission android:name="com.shop.shoppinglist.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<permission android:name="com.shop.addtask.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.shop.addtask.permission.MAPS_RECEIVE"/>
package name is
package="com.shop.shoppinglist"
Hope below link helps you, AndroidManifest.xml for Google Maps Android API v2
try this,
<permission android:name="com.shop.shoppinglist.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.shop.shoppinglist.permission.MAPS_RECEIVE"/>
After everything fails, try to uninstall the app and try it again. It worked in my case.
My problem was that I've changed the app's package name in the AndroidManifest file, but not the gradle.build's "applicationId" property, maybe that helps someone...
I had the same problem. I tried everything suggested on the different solutions on this error. Inclusively, I recreated my API key(including creating a new project) and nothing worked. After many, many hours wasted, I decided to delete all myapp user data on my android device, and magically this took care of the problem. My maps display correctly! Yay!!!
Android 4.2.2: Settings/Apps/YourApp/Clear data.
I hope this simple solution helps when everything else fails.
ok, I have the same problem, I follow all the steps in the blogs and the google official page and not working, the solution is correct
<uses-library android:name="com.google.android.maps"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my api key"/>
before close the application tag, but in the other case I found the solution, the problem is I generate SHA1 code in a macinthosh but I clone the repository and work in windows plataform but I found this problem, my solutions is that go to google console and generate other apikey but get the SHA1 code using this comand in windows,open the console
and typed this code
cd C:\Program Files\Java\jre1.8.0_20\bin and press enter
next step copy and paste this code
keytool -list -v -keystore %HOMEPATH%\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
after press enter inside the console you show the SHA1 code copy and paste in a google console,is very important specified SHA1 code ";" and correct package ..
regards!!!
I 've got a similar problem with the map. After fixing all lib and key problems, I just saw a white sreen labled with "Google".
The problem was, that I put the MapFragment into a ScrollView. After removing the ScrollView everything works fine. I can see the map.
Check whether you enabled Google Maps Android API or not
Open Google Map developer console.
Go to Library -> Google Maps Android APIs
If it is disabled, enable it.

Google MapFragment is blank (white) with Could not find class 'maps.j.k'

I'm trying to build the official android google map api v2 sample on a (gingerbread 2.3.5) phone .
I added android-support-v4.jar to official sample project.
I took the sample from the official tutorial in <android-sdk>/extras/google-play-services/samples/maps
I copied the sample app in Eclipse, reference the google-play-services_lib project as an Android library, and build the whole thing with the Android SDK 4.1.2 (api 16).
Unfortunately, ahen I launch the app the map is blank and I don't have any exception or message.
The only thing I got are those suspicious lines in the logcat :
Unable to resolve superclass of Lmaps/a/du; (411)
Link of class 'Lmaps/a/du;' failed
Unable to resolve superclass of Lmaps/a/ej; (2363)
Link of class 'Lmaps/a/ej;' failed
Unable to resolve superclass of Lmaps/j/k; (2379)
Link of class 'Lmaps/j/k;' failed
ERR Could not find class 'maps.j.k', referenced from method maps.y.ae.a
VFY: unable to resolve new-instance 3571 (Lmaps/j/k;) in Lmaps/y/ae;
I suspect that my project structure in eclipse 3.8 is somewhat messed up.
I tried the following things (even the most idiotic) to no avail.
1. Invalid api key ?
I generated a "debug.keystore" with keytool and updated the eclipse preference (Android/Build/Keystore).
Of course, I registered that new keystore/SHA1 and get a new api key that I used in the AndroidManifest file
2. Wrong project target ?
I tried to build my two projects with the following targets :
Android 4.2.1
Google Api 4.2.1
3. adding google-play-services_lib as a project dependency
I tried to add google-play-services_lib as a project dependency on top of being added as an android library in the demo build path.
And tick the matching export checkbox.
4. test google maps api v2 on the phone
I downloaded trulia real estate app that is said to use the v2 api on the phone to be sure that the phone is compatible with the new api
Here is the manifest for the sample app
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapdemo"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE" />
<!-- Copied from Google Maps Library/AndroidManifest.xml. -->
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<!-- End of copy. -->
<application
android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/demo_title" >
<!-- You must insert your own Google Maps for Android API v2 key in here. -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="XXXXXXXX" />
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".BasicMapActivity"
android:label="#string/basic_map" />
<activity
android:name=".CameraDemoActivity"
android:label="#string/camera_demo" />
<activity
android:name=".EventsDemoActivity"
android:label="#string/events_demo" />
<activity
android:name=".GroundOverlayDemoActivity"
android:label="#string/groundoverlay_demo" />
<activity
android:name=".LayersDemoActivity"
android:label="#string/layers_demo" />
<activity
android:name=".LocationSourceDemoActivity"
android:label="#string/locationsource_demo" />
<activity
android:name=".MarkerDemoActivity"
android:label="#string/marker_demo" />
<activity
android:name=".OptionsDemoActivity"
android:label="#string/options_demo" />
<activity
android:name=".PolygonDemoActivity"
android:label="#string/polygon_demo" />
<activity
android:name=".PolylineDemoActivity"
android:label="#string/polyline_demo" />
<activity
android:name=".ProgrammaticDemoActivity"
android:label="#string/programmatic_demo" />
<activity
android:name=".TileOverlayDemoActivity"
android:label="#string/tile_overlay_demo" />
<activity
android:name=".UiSettingsDemoActivity"
android:label="#string/uisettings_demo" />
<activity
android:name=".RawMapViewDemoActivity"
android:label="#string/raw_mapview_demo" />
<activity
android:name=".RetainMapActivity"
android:label="#string/retain_map" />
<activity
android:name=".MultiMapDemoActivity"
android:label="#string/multi_map_demo" />
</application>
</manifest>
Here are some screenshots of my project structure/build path.
I think maybe you make something wrong when you apply the api KEY.
I have the same problem, and at last I found that I turn on the incorrect service. at https://code.google.com/apis/console/,
There are Google Maps API v2 and Google Maps Android API v2.
You should use Google Maps Android API v2.
I had exactly the same problem (all configurations the same, maps.j.k stuff in the logcat). However, for me choosing Google APIs as build target solved it. But that was Google APIs 4.2, so I suggest that you install the update and try with the more recent target.
I resolved this issue by changing de targetSdkVersion with de last targetSdkVersion avaiable, at the AndroiMainfest.xml file.
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
Are you using ProGuard? Usually class names like "a", "b", etc. are a result of ProGuard obfuscating class names, and maybe the Maps API breaks when that happens. If that's the case, you will either have to disable ProGuard or add some -keep lines to your proguard.cfg file. This post shows what those lines might look like.
In my case it was due to 2 issues
on my phone the latest Google Maps app was not installed (in fact there was no google maps at all)
I didnt have all the required permissions set in my manifest
<uses-permission android:name="android.permission.INTERNET"/>
<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_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
As documented in https://developers.google.com/maps/documentation/android/start#installing_the_google_maps_android_v2_api
http://developer.android.com/sdk/index.html --this is the link for the adt bundle in android..try downloading this and start over again..maybe there's a problem with your ADT.
Check the console API you've enabled Google Maps Android API v2
I was dealing with same issue. I tried to implement the com.example.mapdemo and had a heck of a time.
I copied the code of the BasicMapActivity to a clean new project and made the Libraries look as above.
Basically, I couldn't get either to work. I got the "Authorization failure" error in the debugger.
Then, today, I prepared new keys specifically for each project with the specific com.example.xxx after the semicolon when preparing the key in the Google Console.
I did Project->Clean at every step.
I ran it in debugger first, then just Run. And, if I remember, a few times after making the change to the manifest.
Then, finally, they worked. It seemed, in the end, to require a key for each specific project.
Here's what worked for me. When you use the Google APIs Console to create your API key, be sure to append ;com.example.mapdemo to the SHA1 fingerprint. (I was using something else more appropriate for another app I'm currently developing.) What clued me in on this solution was an authorization error in the LogCat.
In my case I added LocationSource Interface so I can get location data but i forgot to add :
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
at Manifest file.
Don't forget to use separate keys for debug and release version of the app!
If you have already tried everything, try to uninstall and reinstall again your app: on my phone (S3 mini), after the first launch with the wrong key, I corrected it, but it didn't work until a complete uninstallation.
Maybe some sort of caching is used.

Categories

Resources