In my project the Maps and everything, but when I generate a signed APK it doesn't works, I already have the "google_maps_key" in my project, I went to Google Console and put any restriction so I could test not just from my Android Device and still nothing!
You should create a release key and add it to your project .
Release APK file not showing google maps
This link answers you proble. It's a common problem .
You should create a .jks file first and store it somewhere in you app folder.
Then Create a SHA1 Fingerprint n put it on the credentials site.
Related
I am struggling a lot with google and Facebook sign-in in my android app. Everything works well with release build if preparing in APK format but not with.AAB format. I have followed all steps required for signing a build related to the SHA1 key.
Setup the Firebase application
Add the debug, release SHA1 key to the firebase
Add the SHA1 signing key from the google play issue after uploading the app.
Then download the google-service.json file and then prepare the bundle (.aab) but still, it's not working.
For facebook sign in also works with release apk but not with .".aab" file
App uploaded to google play and then download it but still, it's not working.
I tried to debug the ".aab" and it throws the "result code 0", the debugging I have to perform on the ".aab" file through the AAB installer app.
I followed various articles on stack overflow and other sources but none of them worked. Seems problem only with Bundle (.AAB) file releases only.
Facebook login in my android app is working fine in release apk, but not working properly after publishing the same apk on play store
google signIn not working in release mode apk android
enter image description here
the same thing happened to me and I solved the problem in the following way:
Unlike with .apk, when uploading an .aab (app bundle), google now forces you to sign the file and it does so by default. when google signs it, it does so with a SHA1 that you can only see by accessing your google play console account in the signature section: (if you dont see the link, search in google by "Google Play Console - Play App Signing")
https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwiIn4b9j5PzAhVIndUKHfJEAuAYABAAGgJ3cw&ae=2&ohost=www.google.com&cid=CAESQOD2TOEC6QJViajlQLRKWuvyHeLErSwY_0eyjSXNXz3AzjyZhnMyB4frcnJdvfIXrAYvu5aNaGiEi2zTH_tFodY&sig=AOD64_2z6obL_QhyUwCO5ViGSBr7v6_mCQ&q&adurl&ved=2ahUKEwjElf78j5PzAhWCy4UKHUo2A5QQ0Qx6BAgCEAE
This is where you can see the SHA1 used by google: this SHA1 is the one that you must put in the firebase configuration (not the sha1 of your private signature in the aab file, but the sha1 of the google signature)
If you are using .aab then simply logon to play console and follow the steps
Select your app
Under release navigate to Setup menu
Click on App Integrity
A screen will open, then click on App Signing
Copy the SHA1 key and paste where you want to use.. :)
See this image for steps
I have spent around two days to fix this problem and finally I did it, it is just missing SHA certificate fingerprints.
For the APK file it is working fine and when I have used the AAB file and install it in device then Google Sign In didn't work.
You can find the SHA-1 certificate fingerprint from Google play console by following steps:
Login to Google play console.
Select your application.
Go to Setup section from left side.
Select Internal app sharing and click on it.
Here you can find the Internal test certificate and SHA-1 certificate fingerprint, please confirm it is missing in your Firebase project or not, if it is missing then just add it and it is working fine with AAB file too.
0
If you are using .aab then simply logon to play console and follow the steps
1- Select your app
2- Under release navigate to Setup menu
3- Click on App Integrity
4- A screen will open, then click on App Signing
Copy the SHA1 key and paste to you firebase console under android project
https://console.firebase.google.com/
This is unreasnable and painfaul.
After update firebase settings by Sha-1 from google play console
and generate signed APK all worked fine
but .aab worked only with me in internal testing not when upload it to third party like appcenter
I want to generate and use a google API key.
enabled google maps v2 API
created project with one activity with google map (default wizard in studio)
created key on google for debug project, assigned SHA1;app package of application to the project key on google
API key inserted into google_maps_api.xml (AndroidManifest.xml updated automaticaly)
build & run on AVD on which the app is working, map is shown.
Then:
API already enabled
in Android studio created keystore for release (keystore.rel.jks)
generated fingerprints (keytool -list -v -keystore C:\Dropbox\AndroidKeyStore\keystore.rel.jks)
on google added new fingerprint to the new release project (release SHA1;app package) - key generated AIza...
API key inserted into google_maps_api.xml (AndroidManifest.xml updated automatically)
generate signed app (using keystore.rel.jks) & install on real device ... app is working, map is STILL BLANK, only zoom buttons and Google label is on
Make sure you enter your release API key in the google_maps_api.xml under the release folder.
First, switch to Project view by using the dropdown in the upper left of the Project Explorer. Then, expand app/src/, and you will see subfolders debug and release. Under there, you should see two separate google_maps_api.xml files under debug/res/values and release/res/values.
Make sure that the release API key is in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk.
i was tired of trying over and over again, it turns out that PlayStore has something called App signing certificate, and the map works after i copy that sha1 and paste it in the google console for the android map.
When you try to create map api key please make sure the url contain correct package name. It should not take any sub package like this.
wrong package :com.gpslocation.trackerpro.Activities
correct package :com.gpslocation.trackerpro
After editing don't forget to save
Go to https://play.google.com/apps/publish/ and then to App signing:
Maybe you will see this:
If that is the case, maybe you are a developer and not the account owner. You will have to contact the account owner and ask him/her to complete that process. Follow this article about how to do that:
https://learnfreecoding.com/how-to-sign-your-android-app-with-signed-key-private_key-pepk/
The account owner will get to this screen:
Ask them to choose Upload a key exported from Android Studio. They will have to upload a private_key.pepk file. This is how you get that file from Android Studio:
Go to Build > Generate Signed Bundle / APK....
Select Android App Bundle and click Next:
Provide the corresponding credentials and make sure to put the check on for Export encrypted key for enrolling published apps in Google Play App Signing.
Specify the destination folder and make sure you select release before you click Finish:
That will generate the private_key.pepk file that you need to provide to Upload a key exported from Android Studio.
After doing the above, when you to to the App signing section of your app, you will see something like this:
Then you will see the Google Maps working correctly on real Android Studio physical devices and not only on the Android Studio Emulator. This was the solution for me.
generally you must do below steps:
1- Create New maps Activity in android studio
2- In google_maps_api.xml open the link in line 3
3- Confirm data and get key in Firebase
4- Copy key in google_maps_api.xml debug and release
5- Get release SHA1 in gradle tab -> signing report
useful link for get sha1
useful link for sign application in debug mode to get sha1
Make sure you enable the Maps for Android app in Google Console.
Make sure the map key you entered in google_maps_api.xml file is the same android key, generated by google console.
You can also try a new key.
Got stuck on this issue for a day. I tried everything and eventually found the following code in my manifest:
<supports-screens
android:anyDensity="false"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="false"
android:xlargeScreens="true" />
After removing these lines my maps displayed correctly.
I faced the same problem, in my case fingerprint of my package used in google map API key was mismatched so what i did:
Create a new google map activity.
Go to google_maps_api.xml.
Copy the link given in that file in paste in browser(login to google account).
On google create some project here and press continue
Click on create API key
Copy the key and paste in google_maps_api.xml
string name="google_maps_key" templateMergeStrategy="preserve" translatable="false"YOUR KEY HERE
And execute the application
Do not use below fingerprint, or key, create your separate it is based on package ans application
Please follow these steps:
Go to Google Play Console -> Setup -> App integrity -> App signing key certificate
Copy the SHA-1 certificate fingerprint
Open Google Cloud Platform
Go to APIs & Services -> Credentials
Click on your API key
Go to Application restrictions -> Restrict usage to your Android apps
Click on ADD AN ITEM
Add your package name with the copied SHA-1 certificate fingerprint
Wait for around 10 mins. and your maps would be visible on your published app.
I want to generate and use a google API key.
enabled google maps v2 API
created project with one activity with google map (default wizard in studio)
created key on google for debug project, assigned SHA1;app package of application to the project key on google
API key inserted into google_maps_api.xml (AndroidManifest.xml updated automaticaly)
build & run on AVD on which the app is working, map is shown.
Then:
API already enabled
in Android studio created keystore for release (keystore.rel.jks)
generated fingerprints (keytool -list -v -keystore C:\Dropbox\AndroidKeyStore\keystore.rel.jks)
on google added new fingerprint to the new release project (release SHA1;app package) - key generated AIza...
API key inserted into google_maps_api.xml (AndroidManifest.xml updated automatically)
generate signed app (using keystore.rel.jks) & install on real device ... app is working, map is STILL BLANK, only zoom buttons and Google label is on
Make sure you enter your release API key in the google_maps_api.xml under the release folder.
First, switch to Project view by using the dropdown in the upper left of the Project Explorer. Then, expand app/src/, and you will see subfolders debug and release. Under there, you should see two separate google_maps_api.xml files under debug/res/values and release/res/values.
Make sure that the release API key is in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk.
i was tired of trying over and over again, it turns out that PlayStore has something called App signing certificate, and the map works after i copy that sha1 and paste it in the google console for the android map.
When you try to create map api key please make sure the url contain correct package name. It should not take any sub package like this.
wrong package :com.gpslocation.trackerpro.Activities
correct package :com.gpslocation.trackerpro
After editing don't forget to save
Go to https://play.google.com/apps/publish/ and then to App signing:
Maybe you will see this:
If that is the case, maybe you are a developer and not the account owner. You will have to contact the account owner and ask him/her to complete that process. Follow this article about how to do that:
https://learnfreecoding.com/how-to-sign-your-android-app-with-signed-key-private_key-pepk/
The account owner will get to this screen:
Ask them to choose Upload a key exported from Android Studio. They will have to upload a private_key.pepk file. This is how you get that file from Android Studio:
Go to Build > Generate Signed Bundle / APK....
Select Android App Bundle and click Next:
Provide the corresponding credentials and make sure to put the check on for Export encrypted key for enrolling published apps in Google Play App Signing.
Specify the destination folder and make sure you select release before you click Finish:
That will generate the private_key.pepk file that you need to provide to Upload a key exported from Android Studio.
After doing the above, when you to to the App signing section of your app, you will see something like this:
Then you will see the Google Maps working correctly on real Android Studio physical devices and not only on the Android Studio Emulator. This was the solution for me.
generally you must do below steps:
1- Create New maps Activity in android studio
2- In google_maps_api.xml open the link in line 3
3- Confirm data and get key in Firebase
4- Copy key in google_maps_api.xml debug and release
5- Get release SHA1 in gradle tab -> signing report
useful link for get sha1
useful link for sign application in debug mode to get sha1
Make sure you enable the Maps for Android app in Google Console.
Make sure the map key you entered in google_maps_api.xml file is the same android key, generated by google console.
You can also try a new key.
Got stuck on this issue for a day. I tried everything and eventually found the following code in my manifest:
<supports-screens
android:anyDensity="false"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="false"
android:xlargeScreens="true" />
After removing these lines my maps displayed correctly.
I faced the same problem, in my case fingerprint of my package used in google map API key was mismatched so what i did:
Create a new google map activity.
Go to google_maps_api.xml.
Copy the link given in that file in paste in browser(login to google account).
On google create some project here and press continue
Click on create API key
Copy the key and paste in google_maps_api.xml
string name="google_maps_key" templateMergeStrategy="preserve" translatable="false"YOUR KEY HERE
And execute the application
Do not use below fingerprint, or key, create your separate it is based on package ans application
Please follow these steps:
Go to Google Play Console -> Setup -> App integrity -> App signing key certificate
Copy the SHA-1 certificate fingerprint
Open Google Cloud Platform
Go to APIs & Services -> Credentials
Click on your API key
Go to Application restrictions -> Restrict usage to your Android apps
Click on ADD AN ITEM
Add your package name with the copied SHA-1 certificate fingerprint
Wait for around 10 mins. and your maps would be visible on your published app.
I created an Android project on Google dev console using debug SHA1 fingerprint and also generated google-services.json file using same debug SHA1 fingerprint for by Google oauth2 implementation. Everything works fine. To upload the app to Google Play, I created one more project on Google dev console with release keystore SHA1 fingerprint and did not generate google-service.json. However, app is working fine even in release mode and I am able to do Google login in my app.
So what exactly is the use of google-services.json file? Should I create a new google-service.json file for release mode and how is it working even without it? That file has client_id of Android project that I created with debug SHA1 fingerprint.
I have checked both these links - link1 and link2 but did not find any answers satisfying. Thanks.
You do not need another json file for the same project. Google has simplified some manual steps by giving json file. You Google Cloud Project ID is the only thing required at the client side. Google Play Services will check with their server at the time of auth. and if there's a clientId created on the said Cloud project with SHA1 of the app requesting the auth, then it will work.
I have created an Android app and used Android google Maps API v2. and generated signed .Apk file, I have a question for you that when I made changes in my project it does not update my signed .Apk file. For example when I change API key in my AndroidManifest.xml Android Studio does not update it in signed APK file. How it is possible to make changes in signed apk file. ? I am new in Android and StackOverFlow, and excuse for all mistakes in asking question, thankx
When you added API key that generated from your .keystore then you must built signed .apk with the same keystore for publishing the app in store.
and when you provide any updates then there is no need to change the API key again but you must built signed .apk with the same keystore again.