Android SHA1 release keystore not working with Google Maps
You have two google_maps_api.xml files
One in this folder:
app/src/debug/res/values
Other in this folder:
app/src/release/res/values
But only the debug one contains your API key probably.
Google maps not show in release mode android
Add the apikey to debug>res>values>google_maps_api.xml
then add release>res>values>google_maps_api.xml.
Then check it work or not.
Maybe you have 2 google_maps_api.xml files, one in the app/src/debug/res/values folder and the other in the app/src/release/res/values folder, but only the debug one contains your API key.
SHA1 for google map release key is showing some encrypted text
You can use the keytool -list -v
command (documentation):
keytool -list -v -alias razon** -keystore E:\keystore\keystore.jks
How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?
Easiest ways ever:
Update added for Android Studio V 2.2 in last step
There are two ways to do this.
1. Faster way:
- Open Android Studio
- Open your Project
- Click on Gradle (From Right Side Panel, you will see Gradle Bar)
- Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project)
- Click on Your Project (Your Project Name form List (root))
- Click on Tasks
- Click on Android
- Double Click on signingReport (You will get SHA1 and MD5 in Run Bar(Sometimes it will be in Gradle Console))
- Select app module from module selection dropdown to run or debug your application
Check the screenshot below:
2. Work with Google Maps Activity:
- Open Android Studio
- Open Your Project
- Click on File menu -> Select New -> Click on Google -> Select Google Maps Activity
- A dialog would appear -> Click on Finish
- Android Studio would automatically generate an XML file named with
google_maps_api.xml
- You would get debug SHA1 key here (at line number 10 of the XML file)
Check Screenshot below:
Android Studio V 2.2 Update
There is an issue with Execution.
Solution:
- Click on Toggle tasks execution/text mode from Run bar
Check Screenshot below:
Done.
Google Maps not working in derived apk (published app)
Ok, I just solved it (after making this post 13 minutes ago).
So after implementing this solution
Android Studio - Google map still blank on real Android device
I noticed that this error in my Android Monitor when running the apk from my phone:
Android Application (<cert_fingerprint>;<package_name>): <what I assume is a SHA1 fingerprint>;<my_package_name>
So I just copied the SHA1 fingerprint, added it to the API credential restrictions and saved it. And after a few minutes, ran the app again, and it worked.
No need to reupload/update apk.
Hope this helped anyone else.
Related Topics
How to Set The App Icon as The Notification Icon in The Notification Drawer
How to Overlap Items in Linearlayoutmanager - Recyclerview (Like Stacking Cards)
How to Detect Android Listview Scrolling Stopped
Getting Gradle Error "Could Not Reserve Enough Space for Object Heap" Constantly in Intellij Idea
How to Keep a Button as Pressed After Clicking on It
Get The Displayed Size of an Image Inside an Imageview
How to Disable Viewpager Adapter on Touching Specific Views
How to Find Android Textview Number of Characters Per Line
Build Flavors for Different Version of Same Class
How to Check Database on Not Rooted Android Device
How to Get Pid of Android Application Without Using Adb Shell
Using Onbackpressed() in Android Fragments
Can't Resolve Android Databinding Class
Android - Set a Progressbar to Be a Vertical Bar Instead of Horizontal
How to Find Memory Leak Class/Activity in Android
How to Enable Autostart Option for My App in Xiaomi Phone Security App Programmatically in Android