Error- Could not contact to google servers - android

With reference to previous error
Link1
I want able to move one step ahead. But now i am facing two new errors.
04-05 14:24:27.156: E/Google Maps Android API(32366): Authorization failure.
04-05 14:24:27.966: E/Google Maps Android API(32366): Failed to load map. Could not contact Google servers.
This is only important content from my Manifest.xml file
<permission
android:name="com.example.task.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.task.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.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"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<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="_MY_API_KEY_GOES_IN_HERE_"/>
</application>
</manifest>
I have referred to the link
Link2
Link3

Make sure all below mentioned points are taken care:
1) Wrong service was enabled. Make sure the "Google Maps Android API v2", not "Google Maps API v2" is enabled and re-generate the API key.
2) Add the following elements to your manifest. Replace com.example.mapdemo with the package name of your application.
3) Use of correct certificate and key. Release certificate, which WILL NOT WORK during debugging when you run the app on my phone. You have to use the debugging keystore certificate fingerprint instead.

Related

Map only appear in debug mode

My map appears only in debug mode, when I install the app on other devices not appear the map. I researched about it and realized that I have a key to debug and one for production. I do not know how to do this, google console can only have an api key for android apps.
This is my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mypackage"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21"/>
<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.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="app.akexorcist.googlemapsv2direction.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<permission
android:name="app.akexorcist.googlemapsv2direction.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher_app"
android:label="#string/app_name" >
<activity
android:name="mypackage.Main"
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=".Search" ></activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="myapykey" />
</application>
</manifest>
Read this: https://developers.google.com/maps/documentation/android/start#get_an_android_certificate_and_the_google_maps_api_key there is a step by tutorial how to use Maps API v2
Your map key is associated with a signing key.
Your debug application is likely signed with one key and your production application with another.
If that is true, you need to have two map keys in your application , one for debug and one for production. So you create two map keys in the API Console ( one for each signing key ).
Put both keys in your Manifest, but comment out the one your are not using,
So just before shipping comment out the debug map key and uncomment the production one.
Make sure you check the production APK before shipping :) Hate to have a product with no map.

App cannot connect to Google servers for access to Google maps

I've been working on an android app for the past little while and I wanted to set it up to connect to Google Maps. I've been writing it inside Eclipse with the ADT plugins. I followed this tutorial but I've been getting the following Error when I try to load maps.
"failed to load map. error contacting google servers. this is probably an authentication issue (but could be do to network errors)"
Since I can access google maps in other apps it has to be an authentication error. I've tried uninstalling the app from my phone but that does not fix the error.
The SHA1 that eclipse is using (according to window > properties > android > build) is 58:EF:6F:DE:DE:B4:4E:EB:20:15:68:39:08:5D:87:32:FE:20:99:99
I used this to generate an API key in the google console which you can see contained below in my manifest file. The app I specified in the console was 58:EF:6F:DE:DE:B4:4E:EB:20:15:68:39:08:5D:87:32:FE:20:99:99;com.example.test. It may be worth noting that I'm loading the map inside an activity located in the gui package, not the com.example.test package that contains MainActivity.
I've been testing this on my nexus 5 by clicking play in eclipse while the phone is plugged into my computer.
<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="18"
android:targetSdkVersion="19" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<permission
android:name="com.example.test.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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" />
<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" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBsTBliiyhE2G4Navzfc1ANeI9f7JwAtEM" />
<activity
android:name="com.example.test.MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="gui.SetLocationActivity"
android:label="#string/title_activity_set_location" >
</activity>
</manifest>

Run Only Google Maps Android API v2 3

I know this topics already have posted. But I am not success for this work.I can not run google map v2 in emulator. Now I am trying BlueStack. When I run BlueStack then it show Get Google Play Service. What I do please tell me.How I can run google map v2 successfully.
My AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gmapdemon"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/>
<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.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" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY_KEYandroid"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"
/>
<activity
android:name="com.example.gmapdemon.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>
Create an emulator from genymotion that supports google map api. You can look this up.
Find a download for the app store that will run on your emulator. I found mine here: http://wiki.rootzwiki.com/Google_Apps#Universal_Packages_2... I was using the 4.2.2 version.
Drag and drop that into your emulator. I am using google nexus.
Say ok to the prompts.
Once everything is installed close down the emulator and restart.
sign up with a good account.
VoilĂ 

My Android App shows the google map in debug but doesn't show it when released to the market

I have an app that I have created that uses the Google Maps and Google Playstore and in debug using Eclipse and the Android SDK the map shows up on the device I am running but when released it doesn't show up on the app. Theres just a big grey screen.
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" />
<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>
</manifest>
Could it be the Keystore. I have a release keystore file that was generated do I need to get the keystore from that if so how?
Are you just seeing gray screen then... it's almost definitely the API key that is wrong. The Emulator uses the debug keystore, with androiddebugkey, so you should create an API key for that. Remember to change it when you publish the app to the market
refer this
When U make your apk file. U need create a keystore. Now, using that keystore to get MD5 using "Keytool", like you did with debug keystore. After that, U need to register API key from MD5, you just got. And late, U use API key in your android manifest.
I assume it is a keystore problem.
Get the SHA1 from the keystore using the "keytool"
And register it like you did with the debug keystore.
And you are good to go.

Google Maps is showing grey tiles after publishing the apk in Play Store

I work with Google Maps Android API v2 to show some Map Fragments in my App.
Everything works until my App is published in the Play Store (I checked my exported APK before it is published and it worked just fine when sideloaded).
I have an assumption, but first the situation:
I write and sign the app (Also the API Key is from my account).
When the app is ready, another person (with another account in the Play Store) is publishing the App.
Is it possible that the API Key has to be generated from the same account that is publishing the App? I appreciate every hint!!!
My Manifest looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.example.android"
android:versionCode="9"
android:versionName="2.2.0.1" >
<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"/>
<permission android:name="de.example.android.permission.MAPS_RECEIVE"
android:protectionLevel="signature"></permission>
<uses-permission android:name="de.example.android.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-feature android:name="android.hardware.location.network" android:required="false"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:name="android.hardware.location.gps" 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="#style/AppBaseTheme">
<!-- GOOGLE MAPS START -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="..." />
<!-- GOOGLE MAPS END -->
<activity
android:name="de.example.android.SplashScreen"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/Theme.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="de.example.android.MainActivity"
android:screenOrientation="portrait"
android:icon="#drawable/ic_launcher_activity"
android:theme="#style/AppBaseTheme"
>
</activity>
<!-- This Activity is called from a lib -->
<activity
android:name="de.example.testlib.android.MapActivity">
</activity>
</application>
Did the person publishing the app resign the APK with some other keystore?
did you generate a key for the map by using the Keystore and Alias which are used in creation of the publish apk? and after that did you give it to your mapview?
Google generates two keys, one for testing and one for production. Have you change the key to production key before compiling the apk for final release ?

Categories

Resources