Authorization Failure with Google Map API key - android

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.

Related

Google map Authorization failure

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.

IllegalStateException: meta-data tag in the AndroidManifest doesn't have a right value

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.googlemaptest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<permission
android:name="ca.sfu.cmpt276.bfraser.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="ca.sfu.cmpt276.bfraser.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" />
<!--
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.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBR9iGtWO-bIbQ7-Fpxd8HFe9cZ53RX_Vo" />
<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>
</application>
</manifest>
Trying to figure out how Google Maps integrate with Android and Eclipse, I followed the documentation and did what I was supposed to, but I keep getting the error mentioned in the title, saying that the value isn't right, it is expecting 5089000, but is getting 0, presumably from the line
android:name="com.google.gms.version"
android:value="#integer/google_play_services_version" />
Googling this error, I've found out that most people forgot this meta-data tag, but as you can see, I put it where it's supposed to be, and I've also imported the proper library and included it in the project, but I'm still getting the error.
Anything else that might be causing this?
I've got the proper API key generated, I've downloaded Google Play Services via SDK and I don't see that I've missed any steps.
I believe it should be
android:name="com.google.android.gms.version"
not
android:name="com.google.gms.version"

Couldn't get connection factory client in error log

I'm starting using google maps and i added
<uses-permission android:name="android.permission.INTERNET"/>
<uses-library android:name="com.google.android.maps"/>
in my manifest file as well as apikey i got from google.
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="api_key_here"
android:id="#+id/mvMain"
android:enabled="true"
android:clickable="true"
/>
But on running the program, "Couldn't get connection factory client" shows up in Error log.
I will greatly appreciate any help. thank you.
This is working manifest file and take a look into this. If you are missing any thing inside your manifest.xml file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Package_name"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<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" />
<!-- TODO: Replace "com.example.hellomap" with your package name -->
<permission
android:name="PACKAGE_NAME.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="PACKAGE_NAME.permission.MAPS_RECEIVE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="PACKAGE_NAME.MainActivity"
android:label="#string/app_name"
android:windowSoftInputMode="stateHidden" >
<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="API_KEY" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>

Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map

I am trying to load a google map on screen.
I Googled it and tried all possible ways, but the screen shows a white screen and getting authorization failure error in logcat.
I have added Google play services to the project.
Created an API key and added in manifest file. but can not understand where I did wrong.
My manifest file:
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<permission
android:name="com.pgi.root.permission.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="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.pgi.routviewer.permission.MAPS_RECEIVE" />
<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" >
<activity
android:name="com.pgi.routviewer.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>
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyC3-blwKU7GgsARUaPNPXXVOMZPvixetKk" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" >
</meta-data>
</application>
Please help me...
Just noticed an error in your manifest file. You use a permission named "com.pgi.routviewer.permission.MAPS_RECEIVE" but defined the permission like this:
<permission
android:name="com.pgi.root.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
You should probably change it to:
<permission
android:name="com.pgi.routviewer.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />

Android App with Google Map is only showing map of Africa and will not load users current location?

I have an Android App that uses Google Maps and Google play when the user downloads the app and brings up the map the default view of Africa stays up and will not go to the users location. When I built the app I pulled up the SHA-1 from my release keystore and added it to the Google API Console which gave me my Release key which I added to my AndroidManifest.xml. When I run the app from debug mode or the Google Play the map brings up my current location with a route of where the user needs to go. Any suggestions?
My AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.eema"
android:versionCode="5"
android:versionName="5" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="10" />
<permission
android:name="com.eema.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.eema" />
<uses-permission android:name="com.eema.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" />
<!--
The following two permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<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/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<!-- <meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" /> -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="OOOOOOOOOOOOOOOOOOOOOOOOO" />
<activity
android:name="com.eema.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.eema.MapViewActivity"
android:label="#string/title_activity_map_view" >
</activity>
<activity
android:name="com.eema.NoConnectionActivity"
android:label="#string/title_activity_no_connection" >
</activity>
<activity
android:name="com.eema.ShelterActivity"
android:label="#string/title_activity_shelter" >
</activity>
<activity
android:name="com.eema.FuelStopActivity"
android:label="#string/title_activity_fuel_stop" >
</activity>
<activity
android:name="com.eema.DirectionsActivity"
android:label="#string/title_activity_directions" >
</activity>
<activity
android:name="com.eema.EvacRouteTableActivity"
android:label="#string/title_activity_evac_route_table" >
</activity>
</application>
This can happen if the users location isn't reaady when you set it. The default position for the map is over europe and africa so if thats what you are seeing then its probably that your user location is null or empty.

Categories

Resources