I've made a chat app that uses Firebase's feature Real-time database.
I face a problem with google authentication. The problem started when I downloaded the app from the Play Store, the authentication was working perfectly when I was running the app in debug mode. When users try to sign in they get a toast message code:10 message:10.
I would like to note here that: I've added the SHA1 fingerprint. How can I solve this?
*Not sure if this is helpful but I've followed step by step this tutorial
You need three keys in order to make it work:
The debug key. Informations here.
The release key. Informations here.
Google Play App signing key. Informations here.
All these keys are needed in order to make the sign-in process work.
Other informations here.
After generating SHA1 for release key, I forgot downloading the new google-service.json file that caused the same error.
Make sure you follow the instruction https://developers.google.com/android/guides/client-auth to generate and add debug/release SHA1 to firebase console and download google-service.json after updated.
If you use Use app signing by Google Play option, you need an additional step:
After uploading app into google play console, go to Release management > App signing, copy SHA1 and paste to firebase console
Update
In the new google play console, the App signing key can be found as following:
Setup > App signing
Make sure you have added signed SHA1. If you are using debug one then it will not gonna work for live apk.
You need to put "debug.keystore" in this path C:\Users\USER_FOLDER_NAME.android
then in Android studio follow the below steps
1. Run your project
2. Click on Gradle menu
3. Expand Gradle Tasks tree
4. Double click on android -> signingReport
You can see SHA in Run Tab
for more information see link
For me the problem was that i registered app and enabled google signin on Firebase console but I was testing with the debug version of app which has slightly different package name (same name but ended with .debug) so it was not working because the debug app is not yet registered. so additionally to my release app i also added the debug app to the firebase project for the app and it generated it's own google-services.json which i download and set to src/debug/google-services.json.
I believe this might be useful to some one else.
I've made a chat app that uses Firebase's feature Real-time database.
I face a problem with google authentication. The problem started when I downloaded the app from the Play Store, the authentication was working perfectly when I was running the app in debug mode. When users try to sign in they get a toast message code:10 message:10.
I would like to note here that: I've added the SHA1 fingerprint. How can I solve this?
*Not sure if this is helpful but I've followed step by step this tutorial
You need three keys in order to make it work:
The debug key. Informations here.
The release key. Informations here.
Google Play App signing key. Informations here.
All these keys are needed in order to make the sign-in process work.
Other informations here.
After generating SHA1 for release key, I forgot downloading the new google-service.json file that caused the same error.
Make sure you follow the instruction https://developers.google.com/android/guides/client-auth to generate and add debug/release SHA1 to firebase console and download google-service.json after updated.
If you use Use app signing by Google Play option, you need an additional step:
After uploading app into google play console, go to Release management > App signing, copy SHA1 and paste to firebase console
Update
In the new google play console, the App signing key can be found as following:
Setup > App signing
Make sure you have added signed SHA1. If you are using debug one then it will not gonna work for live apk.
You need to put "debug.keystore" in this path C:\Users\USER_FOLDER_NAME.android
then in Android studio follow the below steps
1. Run your project
2. Click on Gradle menu
3. Expand Gradle Tasks tree
4. Double click on android -> signingReport
You can see SHA in Run Tab
for more information see link
For me the problem was that i registered app and enabled google signin on Firebase console but I was testing with the debug version of app which has slightly different package name (same name but ended with .debug) so it was not working because the debug app is not yet registered. so additionally to my release app i also added the debug app to the firebase project for the app and it generated it's own google-services.json which i download and set to src/debug/google-services.json.
I believe this might be useful to some one else.
I wanted to update an app I already published in the playstore to add achievements and leaderboard.
I have created the game in the Developer Console and everything was fine, everything worked with the debug SHA1 I have entered in the Google API for my app.
But now I have generated a signed APK with a different SHA1 (of course), and I have changed the debug SHA1 in Google API with the SHA1 for my signed APK.
I have pushed the APK to the playstore and published the game from the Developer Console. But now that my game is available in the store, when people try to connect to the Google Play Games they get "Failed to Sign in. Please check you network connection and try again".
I already looked at this link
but I am doing everything correctly.
Is it possible that I need to wait several hours before Google API handle the new SHA1 I have entered ? I have no idea of what is going on
You may refer with this thread. Try to move the app ID and leaderboard ID from strings.xml to ids.xml in values folder. You may also try to delete all client ids then add them again for debug keystore and release keystore.
Here's an additional reference which might also help: LIBGDX game configuration with google Play game services Errors
Here are a few points that might help you.
It takes several hours before your changes on Developer Console are actually published. Test the game after a few hours.
You don't need to publish in order to test it. You can do that by adding tester accounts in your developer console.
You can't "test" Google Play Services with developer account. You will need another account for that.
Edit:
Very Important:
Make sure you added required permissions to AndroidManifest.xml in
your Android project.
Ok so for everyone having the same problem as me.
Don't forget that now Google can sign your app.
The SHA1 fingerprint i needed was in the developer console, no need to get the SHA1 fingerprint of my APK.
Before publishing in the play store my google sign was working fine. I saw some questions here in stackoverflow, but none of them answered my question. I don't know why the login is not working anymore. (I'm not using firebase).
I did all the steps to make the google sign work, and it was working before I published. Anyone knows what is happening? What can I do?
This is due to different SHA1 keys for debug and release version.
The thing is that for google sign in you must add SHA1 key in your google account which you can get from programming or from command prompt.
SHA1 key is different for signed apk. So you have two SHA1, one each for debug and release version. The SHA1 for release version can be obtained from keystore file.
if you want to read more about this you can check this link. It is very well explained there.
As per #Jan Lovšin stated, maybe you're using same .keystore for your debug and release APKs. Be noted that you need to create two key store - debug.keystore(for debug) and release.keystore (for publish application). You may follow this thread for detailed explanation. You may also check on this related SO question. Hope this helps!
When I switched from my debug map key to my signed map key my maps stop working. I get the following errors in logcat:
09-03 18:18:04.112: WARN/System.err(4073): IOException processing: 26
09-03 18:18:04.112: WARN/System.err(4073): java.io.IOException: Server returned: 3
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
09-03 18:18:04.112: WARN/System.err(4073): at java.lang.Thread.run(Thread.java:1019)
I've double checked everything, permissions and library are in place. I've recreated the singed key and no luck.
Any ideas?
I had the same problem and I figured there wasn't any helpful answer around on the internet so hoping this should help everyone in the future.
When using GoogleMaps for Android, you need two keys - debug and release.
The "debug" key is kind of a misleading term. This key is also to be used when you develop the app in Eclipse. So essentially, use the debug key for development, testing, debugging.
When you're ready to launch the app to Market, set the android:debuggable="false" in the AndroidManifest.xml and use the Signed API key.
When using the signed API key, the MapView will show up ONLY when the app is installed from the Android Market. So, installing the app from Eclipse (Run As, Debug As, etc) or command line (adb install) won't show the MapView. Rest assured, once the app is in the Market - you download it and the MapView will show up.
With the signed API key, if you deploy the app from Eclise, you will get a "Server returned 3, IOProcessing Exception 26" as a warning - just ignore it.
Note: Also ensure there are no duplicate instances of the same MapView. If your app needs "x" no. of MapViews, generate "x" no. of new signed keys (one for each MapView) since GoogleMaps has a query limit for a single MapView instance.
For getting both the keys, follow the steps for Obtaining API keys for GoogleMaps on Android.
Happy Coding!
UPDATE:
The link above for obtaining api keys is now a deprecated procedure. Refer Obtaining API keys for GoogleMaps Android API v2 going forward.
Finally Its fixed.
I am using Windows machine, so I simply went to C:\Users\rohit\.android and deleted debug.keystore and default.keyset1 once this is done, I went to Eclipse and applied a clean build to my project and its done!
Signed map key is used for release app. So you will get such info. if you debug the app via USB-tethered with signed map key. Switch back to debug map key if you want to debug the app, and replace it with signed map key before you release an update or new version.
I had the same problem. In my case, what I was doing wrong was this. I was writing the keytool command like this:
keytool -list -keystore debug.keystore ...
instead of:
keytool -list -keystore ~\.android\debug.keystore ...
So I wasn't updating the Eclipse's keystore with my fingerprint.
I hope this helps someone :)
If you are using a debug key that somebody else has generated and provided to you, that is the reason for the blank map with the following exception.
java.io.IOException: Server returned: 3
You can use this link to get an API key : https://console.developers.google.com/apis/credentials
This link will take you to google credentials page, the new place to get API keys.
I just encountered exactly the same problem.
There is no user-written code that throws the Exception: it is generated in the Eclipse logcat and the result is that you do not see any of the Google map tiles. Like Jen, I regenerated the key, to no avail.
The platform is Android 3.2, the device is the Asus Transformer, the connection is WiFi.
FYI my Android 2.2 application works fine, retrieving the map on a Droid over 3G.
Here is the solution to my problem, hope it helps Jen:
In my case, if I install the release version onto the Transformer using the "Debug as" Eclipse icon, with the Transformer USB-tethered, the map is failing as described above (FYI this is a procedure I have used successfully many times with Android 2.2 and other devices).
So I tried this instead: I use the Eclipse File|Export... option to create a release APK, and then install that APK onto the Transformer using its Asus Sync application. Everything is fine. The map tiles appear.
one more thing:
After adding -v you must remember that the google API just need MD5 not SHA1.So please check what code you give to google.
I have same question but I think I found the answer!
Decide follow these step https://developers.google.com/android/maps-api-signup and receive your certificate's MD5 fingerprint
While development, if map's not showed, don't worried about this! Simple extract APK use android tools with key tool which's used in first step and use this APK file to install on your phone, you will see MapView
Anyway, while development time, maybe you don't see MapView, but it's till not problem and don't worried about this! Simple wait when finished app & build with your keystore and you will see map display correctly
For the poor souls that tried to build the map example from sdk extras: as soon as I renamed the package from com.example.mapdemo to com.mynmae.mapdemo, the map magically appeared. Yes, I lost an hour searching and trying and it silently rejected the package name.
I'm from the future! I've experienced the exact same problem. But this might be an issue for novice developers.
When you created a new google maps activity in the android studio, there's a link to get yourself an API key inside the google_maps_api.xml file. So what happens when you follow this link is that Google will create a "debugging" key for your project. Which, as Sagar Hatekar explained, is indeed, only meant for testing and dev.
To be more clear, Google identifies your project by the SHA-1 certificate fingerprint (also stated inside the comments of google_maps_api.xml)
So what I'm trying to say is that you CANNOT use the same key for several projects unlike the open/public APIs out there.
https://developers.google.com/maps/documentation/android-sdk/start
In this link, they have a small section with the topic of A slightly less fast way which might be a try to explain this phenomenon.
Therefore, if you are using the same key for a project which, the key is not meant for, try requesting a new key.