I've implemented Google Maps v2 on my emulator, it works fine and displays but I need to test this on an android phone however the map just displays with a blank white screen with zoom buttons. I'm using the debug API key, i don't want to generate a release key just yet, can I still test my maps on a real phone with a debug API key?
If not where can I find the *.keystroke file required to enable me to generate a release key?
I don't have the whole answer but I know you can get the api key on this website :
Visit the APIs Console at https://code.google.com/apis/console and log in with your Google Account.
Click the api&auth link from the left-hand menu.
Activate the Google Maps API v2 service.
Click the credential link from the left-hand menu.
You'll then find on the right panel the API key
Based on your comment that you compile the app then copy it over I believe this might be the answer.
First remove the app from the phone.
Next plug the phone into the computer via the USB cable (make sure the computer recognizes the phone)
(assuming you are using eclipse)
right click on the project, select run as android application.
From the list select your device, and it should upload the app to your phone using the debugging key with out the need of a production key for the map api
If Map Working on Emulator then it should be work on real Device . There should be no problem with console. Just check for Google Play Service. I think in map white screen with grids are shown. If map shows on Emulator using debug key then it also shows on real Device.
Related
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'm creating polyline route with using google directions API, I'm also trying to animate the route line with using MapAnimator from this link
https://github.com/tintinscorpion/Dual-color-Polyline-Animation/blob/master/uberpolylineanimation/src/main/java/com/logicbeanzs/uberpolylineanimation/MapAnimator.java
this looks nice when i debug the app , it animates well, but creatong release apk , no animation and no route line shown totaly
I had the same issue, the only issue was i was using a key for which directions api was not enabled. I solved it by changing api key with followings enables/added.
Billing enabled
Maps SDk for android (to show map)
Directions API (get polyline/routes data)
Places API (if you are using places search or similar)
Release Signing SHA-1 fingerprint (if key is restricted)
Path for file (app\src\release\res\values\google_maps_api.xml).
So when I published my app on the Google Play Store, I had to change the SHA1 key on Firebase and Google Play API Console to the new one that the Google Play Console generated.
The problem now is if I want to test my app from Android Studio, I need to change the SHA1 key back to the original one. If I do that, then the current users who have already logged in my app will no longer be able to log back in.
How do I test my app when it's dependent on the Google sign in and not affect current users?
Multiple SHA1 fingerprints can be added to a single firebase project. Add your debug key (Android studio SHA1 fingerprint) to your firebase project along with your app's production key. Then download the latest Json file and add it to your project in Android studio.
Sarweshkumar C R's answer is perfect, just adding visualization for total newbies. Both keys can coexist with no problems, in the image I added 3 SHA certificate fingerprints to demonstrate and you can add by clicking 'Add fingerprint'
I'm building a codename one mobile application and i need to fetch a blank google maps on which i can place icons showing my own coordinates (not places i can fetch through the google places api). How can i do that ? Since i don't want to fetch anything other than a blank map, i wonder if i need a webservice for that. I have read that instantiating the MapContainer would show me a blank google map but i am stil getting a osm map (on both the emulator and a real Android 4.4 device). I have already done all the procedures required to get a key and all the steps of the maps demo work fine for me. Now what i need to know is how to be able to get a blank map.
Thank you advance for the answers.
You get OSM on the device as a fallback when initializing the native map failed. Make sure you followed the integration instructions as explained here.
You can debug the issue on an Android device by connecting the device with a cable and launching the DDMS tool from the Android command line SDK. In 90% of the cases this means your SHA1 is different from the one defined in the maps API and this will be printed when you try to open the map.
On the simulator OSM is shown unless you provided the Google maps provider in the constructor.