Authorization Failure in Google Maps Android V2 - android

When I try to debug my project I got this error using debug certificate
I already ensure that my package name and SHA-1 corresponds to my api key
Here's my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="com.example">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="15" />
<!-- Google Maps for Android v2 requires OpenGL ES v2 -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<!-- We need to be able to download map tiles and access Google Play Services-->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Allow the application to access Google web-based services. -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- Google Maps for Android v2 will cache map tiles on external storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Google Maps for Android v2 needs this permission so that it may check the connection state as it must download data -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Permission to receive remote notifications from Google Play Services -->
<!-- Notice here that we have the package name of our application as a prefix on the permissions. -->
<uses-permission android:name="com.example.permission.MAPS_RECEIVE" />
<permission android:name="com.example.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<!-- These are optional, but recommended. They will allow Maps to use the My Location provider. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application android:label="map" android:icon="#drawable/Icon">
<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="map_key" />
</application>
</manifest>
Here's my API KEY
Here's my SHA-1 certificate
I got my SHA-1 using eclipse
By the way I'am using real device in debugging my project, c#, visual studio 2012 and xamarin.android. It only displays white screen with google logo and zoom in and out button. What's wrong with my debug certificate?

If the key is new ( has just been created in Google APIs Console ) it will take some time for it to be available to Google Maps.
Don't worry everything is declared OK, it just takes some time.
Edit : By what is written in the log looks like you have to add the fingerprint for your debug key store : D9595..
Just add a new line in Google APIs console with that fingerprint . Your debug keystore is found at C:\Users\.android\debug.keystore and the default password is : android

Related

Google Maps v2 Autorization failed

This error appears. Sorry for that question, but I can't investigate it.
12-29 12:03:59.705: E/Google Maps Android API(15395): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
12-29 12:03:59.720: E/Google Maps Android API(15395): In the Google Developer Console (https://console.developers.google.com)
Google Maps Android API: Ensure that the following correspond to what is in the API Console: Package Name: com.example.testmaps, API Key: XXX, Certificate Fingerprint: ZZZ
Google Maps Android API: Failed to contact Google servers. Another attempt will be made when connectivity is established.
Google Maps Android API: Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
This is code of Manifest file:
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="21" />
<permission
android:name="package.app.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="package.app.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.android.vending.BILLING" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
<uses-library android:name="com.google.android.maps"/>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data android:name="com.google.android.backup.api_key"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
</application>
I checked API KEY on console and enabled Google Maps Android API v2. But all the monkey job.
Also I tried to use signed application but now all SHA1 keys which sended on server are correct.
this log maybee needed:
12-29 14:41:30.465: I/Google Maps Android API(27463): Google Play services client version: 5084000
12-29 14:41:30.465: I/Google Maps Android API(27463): Google Play services package version: 6599038
Checked on Samsung S4
Solution:
Seems it is need to use
import com.google.android.gms
instead of
import com.google.android.m4b
for maps

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.

Titanium SDK: The Google Play services resources were not found

I'm currently working on getting an old Titanium SDK 1.x app working in the modern era on Titanium SDK 3.1.2.
One of the challenges I've managed to find myself stuck on is after upgrading from Google Android Maps API v1 to v2 I'm consistently getting this error:
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
I have installed in the ADK the 18.0.1 build tools as well as the required Google Play Services extras package. Uninstalling/reinstalling does nothing useful, and as far as I can tell there's no way to manually include the Play Store Services library in Titanium.
For reference I followed the instructions here to set up the Maps API v2 in the app. The following is what is in my tiapp.xml file (I replaced the actual package names):
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-permission android:name="com.example.permission.MAPS_RECEIVE"/>
<permission android:name="com.example.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<application>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="###"/>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
</application>
Note that the correct certificates and correct API have been used within the Google API Console.
Does anyone have any idea why I might be unable to load the Google Play Services in my Titanium app?
Thanks in advance!
The maps only work on device. Are you running this in the emulator?
I have an additional permission set "android.permission.ACCESS_NETWORK_STATE"
Also double check to ensure your appId is correct and matches what is in your tiapp.xml file
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>14</tool-api-level>
<manifest>
<!-- uses-sdk android:minSdkVersion="11" android:targetSdkVersion="14" -->
<!-- Camera Access -->
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>
<!-- Allows the API to download data from Google Map servers -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- Allows the API to cache data -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- Use GPS for device location -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- Use Wi-Fi or mobile connection for device location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<!-- Allows the API to access Google web-based services -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- Specify OpenGL ES 2.0 as a requirement -->
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<!-- Replace <com.domain.appid> with your application ID -->
<uses-permission android:name="com.wiley.TIgram.permission.MAPS_RECEIVE"/>
<permission android:name="com.wiley.TIgram.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<application android:hardwareAccelerated="true" android:theme="#android:style/Theme.Holo.Light">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="XXXXXXXXXXXXXXXXXXXXXXXX"/>
<activity android:configChanges="keyboardHidden|orientation" android:name="ti.modules.titanium.media.TiCameraActivity" android:screenOrientation="landscape" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
</application>
</manifest>
</android>
This is more of a suggestion than an answer but I got the same error and it made me bark up the wrong tree for quite some time before I realized I had an error somewhere else in the code. In my case, there was a view element that had a null attribute, though that wasn't clear from the stack trace. The Play Services error you pasted above was visible early on but it seems that the compiler will ignore it if the service is found.
:(
To make matters more confusing, I built the same code for iOS and there was no error.

Monodroid Google Maps API v2 - Error contacting Google servers

I am developing a MonoDroid project and can't seem to get past this issue. I am trying to use the MapsAndLocationDemo_v2 project and can't even get the maps to load on the SimpleMapDemo project. I have gone through many SO posts concerning this issue.
The map loads but is white and Application Output states:
[Google Maps Android API] Failed to contact Google servers. Another attempt will be made when connectivity is established.
[Google Maps Android API] Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
I built the Google Play Client Services Library by following the instructions in the project README.md.
I generated a new Android Google Maps v2 API Key using the debug.keystore located at:
C:\Users\[USERNAME]\AppData\Local\Xamarin\Mono for Android\debug.keystore
and replaced the one in the project manifest.xml as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="5" android:versionName="4.0" package="com.xamarin.docs.android.mapsandlocationdemo2">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
<!-- Google Maps for Android v2 requires OpenGL ES v2 -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<!-- We need to be able to download map tiles and access Google Play Services-->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Allow the application to access Google web-based services. -->
<uses-permission ndroid:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- Google Maps for Android v2 will cache map tiles on external storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Google Maps for Android v2 needs this permission so that it may check the connection state as it must download data -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- These are optional, but recommended. They will allow Maps to use the My Location provider. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Notice here that we have the package name of our application as a prefix on the permissions. -->
<uses-permission android:name="com.xamarin.docs.android.mapsandlocationdemo2.permission.MAPS_RECEIVE" />
<permission android:name="com.xamarin.docs.android.mapsandlocationdemo2.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<application android:label="#string/app_name">
<!-- Put your Google Maps V2 API Key here. This key will not work for you.-->
<!-- See https://developers.google.com/maps/documentation/android/start#obtaining_an_api_key -->
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="xxxxxxxxxxxxxMY_KEY_HERExxxxxxxxxxxxxxx" />
</application>
</manifest>
My Android device is running 4.0.3. Google Play Services is installed and up to date on my device.
Any suggestions would be welcome...
Ensure that you have really signed your application with the same key which you had used to get the API key.
And that the application package is the same as was in API key request.
I've lost a few hours with the problem to find out that there was something wrong with application signature.
I've signed it manually and map appears.
Have a look how to check if your app is signed with valid key - otherwise Google Map will not work correctly, auth will be rejected or other such problems.
Check also logcat which probably prints out the reason of this problem.

Google Maps Api v2 Xamarin blank screen

I'm unable to get google maps api v2 to display anything more than a blank screen in my Android Xamarin application.
In logcat, I get the following error.
07-08 16:08:12.192: E/Google Maps Android API(28625): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
This makes me believe it is a problem with my API key. I don't know what I'm missing though. Here is my AndroidManifest.xml.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="2" android:versionName="2.0.0.0" package="com.deg.blubcnmobl.droid">
<uses-sdk android:targetSdkVersion="12" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<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="android.permission.CALL_PHONE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<permission android:name="com.deg.blubcnmobl.droid.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<uses-permission android:name="com.deg.blubcnmobl.droid.permission.MAPS_RECEIVE" />
<application android:icon="#drawable/logo" android:debuggable="true" android:enabled="true" android:persistent="false" android:allowClearUserData="true" android:theme="#android:style/Theme.Black.NoTitleBar">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="MY_KEY" />
</application>
</manifest>
Here is my activity axml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment
class="com.google.android.gms.maps.SupportMapFragment"
android:id="#+id/mapfragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
I have Google Maps Api V2 Android turned on in API settings.
Here is the page where I created the API key.
Make sure you add these permissions to the manifest
<permission
android:name="com.deg.blubcnmobl.droid.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.deg.blubcnmobl.droid.permission.MAPS_RECEIVE"/>
You seem to be missing a number of permissions in your manifest.
Sample manifest for Maps V2 capable of running on API level 8 and upwards
https://github.com/ddewaele/GoogleMapsV2WithActionBarSherlock/blob/master/GoogleMapsV2SkeletonV8/AndroidManifest.xml
Sample layout for Maps V2 capable of running on API level 8 and upwards
https://github.com/ddewaele/GoogleMapsV2WithActionBarSherlock/blob/master/GoogleMapsV2SkeletonV8/res/layout/activity_main.xml
Sample activity for Maps V2 capable of running on API level 8 and upwards
https://github.com/ddewaele/GoogleMapsV2WithActionBarSherlock/blob/master/GoogleMapsV2SkeletonV8/src/com/example/googlemaps/v2/skeleton/api8/MainActivity.java
You can clone the git repository above and try the complete GoogleMapsV2SkeletonV8 application.
Please check this post: Google Map Android Api V2 Sample Code not working, if you are completely sure you did the right steps and still see the blank screen then follow the second answer, the authentication gets cached somewhere, try to uninstall the application manually (just like you do with a normal application) then "Run" again the project.
I have given an answer of it at https://forums.xamarin.com/discussion/26058/google-map-is-showing-a-blank-screen-in-android

Categories

Resources