Google map Authorization failure - android

I can not access my google play services though I have enabled the "Google Maps Android API v2" below the services. I followed the guide for Google Maps Android API v2 at this homepage: https://developers.google.com/maps/documentation/android/start
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bustraffic"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<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" />
<!--
The following two permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<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.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".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>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyHHHHHHHHHHHHHHHH-HHHHHHHHH7Sez7as" />
</application>
</manifest>
I corrected the speeling (bustrafic-->bustraffic) in the screenshoot of Simple API access but it didnt help.
I appreciate any help.

It works now I have just restarted eclipse.

Related

Android googleMap v2 Failed to contact google servers

So I have this problem with GoogleMaps v2 in Android, I'm always getting
06-02 17:06:56.460: I/Google Maps Android API(20121): Failed to contact Google servers. Another attempt will be made when connectivity is established.
06-02 17:07:11.785: E/Google Maps Android API(20121): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
Now I have checked for WIFI state and I have the "READ_GSERVICES" permission, already tried to clear the app data and even reinstall it, Got my SHA1 again and created a new key, I tried with a debug and a release.
Here is my Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<permission
android:name="com.example.test.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" >
</uses-feature>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.example.test.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<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" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:name="com.example.test.App"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.test.activities.SplashActivity"
android:label="#string/app_name"
android:theme="#style/AppThemeNoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.test.activities.MainActivity"
android:label="#string/title_activity_main" >
</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="API_KEY" />
</application>
You have to activate the Google Maps Android API v2 service in your Google Developers Console, in the Menu APIs & auth.
Set it to ON. After making that change, uninstall your app and reinstall it so the changes will take effect.

google-play-services-lib doesnt working with my maps project

Hi people i´m a very begginer developing android apps and i want to do some application using the google maps android api v2, but with no succes.
The step im following are this http://mobile.tutsplus.com/tutorials/android/android-sdk-working-with-google-maps-application-setup/ testing it with a samsung galaxy SIII phonel.
The application simply starts but close inmediatly (5 seconds after) telling the app must be closed.
Attached you can find the logcat with the errors and here is the manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tuxido.example.mapuse"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
<permission
android:name="tuxido.example.mapuse.MAPS_RECEIVE"
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="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="your.package.name.permission.MAPS_RECEIVE"/>
<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" >
<activity
android:name="tuxido.example.mapuse.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>
<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="(my API key)" />
</manifest>
I added the google-services-lin in the workspace as in the tutorial
Thanks before hand
Your meta-data elements should be within the application element. See previous reply. By the way, don't show your API Key.
I am adding one of my manifests from a working program (less the API key of course)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.maptest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<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"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<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.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.example.maptest.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>
<activity
android:name=".NextActivity"
android:label="#string/title_next" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="....."/>
</application>

Android | Google Maps API

Today I've been updating my android app but this isn't going as expected.
I'm using google maps and after the update I don't get it to work anymore.
I got another API key and everything.. Now the difference is I used Google APIs 4.2.2 and after today 4.4
Could it be that the code to display a Google Map changed in these APIs? Is there a way to keep track of the changes and if yes where?
In the old app where it works I use following code in an XML file to display a map
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_below="#id/upper"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="be.khk.mmapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<permission
android:name="be.khk.mmapp.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<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_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/mm_icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="be.khk.mmapp.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>
<activity
android:name="be.khk.mmapp.NewsActivity"
android:label="#string/news_activity" >
</activity>
<activity
android:name="be.khk.mmapp.RetailersActivity"
android:label="#string/retailers_activity" >
</activity>
<activity
android:name="be.khk.mmapp.VoucherActivity"
android:label="#string/voucher_activity" >
</activity>
<activity
android:name="be.khk.mmapp.AboutUsActivity"
android:label="#string/aboutus_activity" >
</activity>
<activity
android:name="be.khk.mmapp.RetailerActivity"
android:label="#string/retailer_activity" >
</activity>
<activity
android:name="be.khk.mmapp.ContactActivity"
android:label="#string/contact_activity" >
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBnVb**************************6pUvk" />
</application>
</manifest>
If anyone could lead me in the right direction that would be nice.
The Google Maps SDK is stored in Google Play Services and is updated independently from the Android OS. What phone are you using? If you flashed a custom ROM, make sure it has Google Play Services. Can you also provide your AndroidManifest?
EDIT: check logcat for authorization failure.

Authorization Failure with Google Map API key

I am building a project for android 4.3 and building to an actual device but my google map always shows up empty and i get an authorization failure.. But everything checks out..
I have a network connection..
LOG ERROR
GOOGLE API CONSOLE
SERVICES IN CONSOLE
My Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sapientnitro.inhouse.drop"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="18" />
<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.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<permission
android:name="com.sapientnitro.inhouse.drop.activities.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission
android:name="com.sapientnitro.inhouse.drop.activities.permission.MAPS_RECEIVE"
android:required="false" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:name=".activities.DRPSplashActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.DRPMapViewActivity"
android:launchMode="standard"
android:screenOrientation="portrait" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA7tcgqzYWAcqLd0ea5qAqHYpaYKTHQv5s" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
problem solved.. i had to uninstall the app, and do a project clean, then re-install the app.. don't know why exactly but now its working
Your API key in your manifest clearly does not match the API key you posted that is showing in the API console. Paste the API key from the console into the manifest. Should fix you right up.

Google Maps - "App won't run unless you update Google Play services"

I'm just trying to run the simple Google Maps tutorial here: https://developers.google.com/maps/documentation/android/start
I'm running my app on my Nexus 4, and I receive the "update Google Play services" message with an Update button. When I click the Update button, it takes me to the Google Play services app on the Play Store, but it appears that it's updated to the latest version.
Is there anything else I might be missing?
Android Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ridenotifier"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="16" />
<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" />
<activity
android:name="com.example.ridenotifier.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>
<activity
android:name="com.example.ridenotifier.ContactListActivity"
android:label="#string/title_activity_contact_list" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyATNKboMr-94m9GUWOlLkEgApQW4uvh4Js"
/>
</application>
</manifest>
Screenshot:
**
According to discussion with Android Developer on Google+, running the new Map API on emulator is not possible at the moment.
Add the following permissions..
<permission
android:name="yourpackageName.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="yourpackageName.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"/>

Categories

Resources