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).
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 am trying to run the following example to display route directions between two locations on Google Map.
https://www.wingsquare.com/blog/drawing-driving-route-directions-between-two-locations-using-google-directions-in-google-map-android/
However, I keep getting the following error in Android Studio run tab when I click on the map to create two markers:
DownloadTask : { "error_message" : "This API project is not authorized to use this API.", "routes" : [], "status" : "REQUEST_DENIED"}
Also, a toast message shows "No route found".
I have the following APIs enabled in Google Developers Console:
Maps SDK for Android
Directions API
Distance Matrix API
Geocoding API
Maps Embed API
Maps JavaScript API
Places API
However, the error message doesn't seem to have changed between enabling each of the APIs.
Once i face the same problem. Then i check the google account for map sdk. There i found that my account was not added with some payment options. Direction API requires payment method. And finally check that you put correct api key in google_maps_api.xml
I've had this problem, just ensure that you have enabled the directions api. You need both the sdk for android/ios and the directions api enabled to get it to work.
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.
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.
I did search the forum for a while but i did not find an answer for this. Recently, Google has changed its Maps API for android from v1 to v2. Since i started the project way before March, i was not aware they would not accept new apps working on the old API. Hence, it's just after i finished my app that i realized the Maps API key was tied to the keystore, and i cannot get a new Map API key for v1 now. And i would have to recode the entire thing to translate it to v2, which i cannot do right now.
My question is, is it possible to doublesign the .apk file and submit it to Google Play. Let's say i have a working .apk signed with my debug keystore. However, the .apk will not be accepted by Google because it uses the debug key. Can i then "resign" it with jarsigner to force Google Play to accept it? Will the app still work if i do this? Really would appreciate help for this asap. I don't have a timeline to recode the app now, and i really want to get visibility for the app in Google Play :/
Can you “doublesign” an android apk file?
No. You can always sign the APK with any key, but that will just override old key.
And i would have to recode the entire thing to translate it to v2
Unfortunatelly there is nothing else you can do except just that if you don't have a signing key and Maps v1 API key.