Google maps does not show up when uploading it - android

So i tried a lot of suggestions online, saw a lot of people have similar problems with it.
So i signed the app for release, generated to keys( understood is better to add to the google maps api release.xml a different key from the debug one) and added the sha1 for the release on console google play after my keystore, still no results.
The only thing i observed and may be a solving is when i am trying to run the app i get the error(1) that states my app is not signed. And found online that i need to go to project structure and sign it -> build types->release -> chose my config. but after i press ok the config dissapears and gradle(3) remains unchanged. ( Would like to mention that in the Project structure i get 2 errors about my SDK/ NDK(2) that says their location should`t contain white spaces but i understood there is no real problem)
Please help, i`ve tried everything i could find.
Thank you,
Daud.

Maybe you can define your signingConfigs in your gradle file manually?
Something like this:
signingConfigs {
config {
keyAlias 'YourKeyAlias'
keyPassword 'YourKeyPass'
storeFile file('./yourKeyStore.jks')
storePassword 'yourStorePass'
}
}
and specify your configuration in buildTypes:
release {
...
signingConfig signingConfigs.config
...
}

Related

Android app - bugs showing only in release bundle

I recently uploaded my first Kotlin-Android app to a closed testing (alpha) track in Google Play Console. The review was complete and I shared my link to some testers. Unfortunately the release bundle has major bugs that are not present in the debug APK! (the one that generates automatically when I hit "Run" in Android Studio). I checked both bundles on my device and the debug version works perfectly fine while the release is unusable. Is there anyway to debug a release version??? Or maybe create a debuggable build that mimics it's behaviour (as a release build is set to be undebugable for safety reasons...). Is there a way to see the app logs? (or are they removed in the release build?)
I think it's important to mention that all bugs are related to Firebase actions. My Firebase project have all the needed "SHA certificate fingerprints" (SAH-1 & SHA-256 for the debug, upload & app-signing keys). Maybe another thing is missing?
Maybe the specific bugs can point to the root of the difference, so these are my 2 biggest bugs:
Each user document holds a list of items which is shown in a recyclerView in one of his screens. In the release version no item is shown. I checked the Firestore console and the items are added successfully (from any version) and they show when I sign in the same user with the debug version.
Can't sign in via phone number (in Firebase auth pre-built UI). The other methods work fine. I can even link a phone to an existing account, but the pre-built sign-in flow stops after I enter a phone number and resets to the initial screen. In the debug version that works fine.
Did someone encounter anything like that?
Any help would be appreciated.
I found the way to debug the release bundle. The problem was that the "release" build variant used the default signing key - the debug key. I had to Configure the build process to automatically sign my app with a secured key. At the end, I have the following code in my "build.gradle (:app)" file:
...
def keystorePropertiesFile = rootProject.file(<keystore.properties file location>)
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
signingConfigs {
ionce {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
...
buildTypes {
release {
...
signingConfig signingConfigs.ionce
}
}
...
}
...
(I choose to Remove signing information from my build files. If you do, pay attention to the "\" orientation in the storeFile field as the error is not very informative. This answer helped me)
If anyone also encounter one of the two issues I mentioned, here are the solutions:
The difference between the build variants was that in my "release" variant I use minifyEnabled true, which changes the attributes' names to minify the code. When getting the document from Firestore it did not match the object structure and failed to load the list. The solution is in this answer.
This one was not related to the difference in build types - seems I didn't check the feature after upgrading firebase-auth library in my gradle. Upgrading the firebase-ui-auth library, like in this answer, did the trick :)
you can add this debuggable true in your gradle file
release {
debuggable true
minifyEnabled false
shrinkResources false
}
this will help you debug the release version, make sure that minifyEnabled and shrinkResources are false
to run the Release version of the app with the Release Keystore use this
signingConfigs {
release {
storeFile file('file location')
storePassword 'your store password'
keyAlias 'your key alias'
keyPassword 'your key password'
}
}
and then add in the variant of release this
release{
signingConfig singingConfigs.release
}

Trying to connect Huawei IAP SDK for Inapp payments - 6003 error

I'm trying to connect Huawei IAP SDK for Inapp payments. After adding an app in developer console and some inapp items, I tried to run Iap.getIapClient(activity).isBillingSupported method, but got com.huawei.hms.support.api.iap.json.IapApiException: 6003 error. Can't get any information about that status code, what does it mean. Does anybody know something about it?
I had the same problem and here is the fix. The error clearly says that 6003 -> StatusCode.CERT_FINGERPRINT_ERROR. It looks like Huawei can't validate the originality of the app, because of the missing certificate.
You either didn't added agconnect to your project or you're running in a different build type (like debug, that was my issue because I added agconnect several days ago).
If you didn't added the agconnect to your project, make sure you add it. There is an official tutorial how to add it, but here is it in a nutshell:
First of all you need to add the agconnect dependency to your project, download the agconnect-services.json file from Huawei's Developer (from your App). You need to obtain a SHA256 fingerprint with keytool and add this long fingerprint to your Huawei's Developer field.
https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/iap-configuring-appGallery-connect#certificate
If you added agconnect (like I did several days ago) and the error persisted, it was because you were running in debug or any other build type which is different than what your official release. If you're running in debug make sure you add the signing certificate to your debug build type.
signingConfigs {
release {
storeFile file('C:\\path-to-your\project\signing-certificate.jks')
keyAlias 'aliasOfYourCertificate'
keyPassword 'theKeyPasswordOfCertificate'
storePassword 'theStorePasswordOfCertificate'
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
signingConfig signingConfigs.release
}
}
So the key here is adding the signingConfig to your debug build type (if you're running in debug).
Check whether the certificate fingerprint is correctly configured on HUAWEI Developer. Sign into HUAWEI Developer, go to Management Center > My Products, and select the services that require fingerprint certificate. In the product service list, check whether the SHA256 certificate fingerprint is same as the one you obtained. If not, modify the SHA256 certificate fingerprint, then clear the HMS cache.
If the issue persists, contact HUAWEI support.
Resource: https://developer.huawei.com/consumer/en/service/hms/catalog/huaweiid.html?page=hmssdk_huaweiid_api_reference_errorcode

GooglePlay - wrong signing key for app bundle [duplicate]

This question already has answers here:
Your Android App Bundle is signed with the wrong key. Ensure that your app bundle is signed with the correct signing key and try again
(27 answers)
Closed 1 year ago.
I've just now started using app bundles. I've set the two certificates in the App signing section of the dashboard (signing certificate and upload certificate).
I've built an app bundle and signed it with the upload certificate, but when I upload the bundle under Android Instant Apps (which is in fact the reason I switched to app bundles) it says that:
Your Android App Bundle is signed with the wrong key. Ensure that your app bundle is signed with the correct signing key and try again: xx:xx:xx:xx.....
I've manually checked the SHA-1 of the upload keystore (using keytool in the terminal) and it matches the xx:xx:xx.... it says in the error message.
What am I doing wrong? The app bundle IS signed with the required upload certificate, but google play doesn't seem to like it.
Ideas?
The solution was a very basic one. I had to clean my project and then rebuild it.
Android Studio was signing my app bundle with the old certificate i was using.
What I did previously is go to Build -> Generate Signed Bundle / APK and i changed the jks file in the file selector to the new upload jks. It seems Android Studio caches the old certificate path and uses it even though I've selected a new one. Might be a bug in AS.
So yeah ... now if I clean the project every time i change the jks file it works, the apk or app bundle gets signed with the proper certificate...
I see there are an answer but in my case I forgot to remove
debuggable = true
from app build.gradle
I tried using the multiple answers here & in this question, but somehow I was getting this error because I had some issues with my android/app/build.gradle and android/gradle.properties files.
Two things you should check (in addition to the other solutions here) are:
In android/gradle.properties and android/app/build.gradle, make sure your keystore variables match exactly.
In android/gradle.properties, you probably have something like this:
MYAPP_RELEASE_STORE_FILE=<>
MYAPP_RELEASE_KEY_ALIAS=<>
MYAPP_RELEASE_STORE_PASSWORD=<>
MYAPP_RELEASE_KEY_PASSWORD=<>
Make sure these variable names exactly match those in android/app/build.gradle:
android {
...
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
}
In android/app/build.gradle, make sure you set signingConfig to signingConfigs.release in your release buildTypes:
android {
...
buildTypes {
debug ...
release {
signingConfig signingConfigs.release
}
}
}
Note: If you're doing react-native development and found yourself here, make sure you follow all steps on "Publishing to Google Play Store". I thought I could skip a few steps without causing problems, and that led to hours of debugging
In my case the issue was Android App bundle, I had forgotten to increment the versionCode for the project and it was not showing that error on the console. Instead, it was showing the error related to certificate SHA.
After a little bit of searching, I found that I accidentally had testCoverageEnabled true in my release build type.
release {
testCoverageEnabled true
...
}
This will make the APK / App Bundle debuggable, and Google Play Console will consider it's not signed. Removing this resolved the issue.
App bundles are just signed using the same format as jarsigner. So you can check the cert hash of your app bundle signature yourself. For example, on linux:
zipinfo -1 ${APK?} \
| grep -E "META-INF/.*(RSA|DSA|EC)$" \
| xargs -I{} unzip -p ${APK?} {} \
| keytool -printcert
If the output from this shows a signature that does match the correct signing key, then there is a bug in Play store, and you should escalate to Play Console support. This is available on the help menu on the Play Console.
On the other hand, if the certificate doesn't match, then even though you think you are signing with the right keystore/key you are doing something wrong, and the app bundle is not signed with the correct upload certificate.
I faced this error because :-
I created a new key for testing and then generate a app bundles/apk
That apk/app bundle had some error so after resolving that error again I created a new key and made a brand new app bundles/apk in which this error occur
so if you did something like this then try to provide a path of first key made with project ,in key store path with same Password and same key alias
This will work because we can only have a one key for a project which is the first key generated. and every time when you want to make a apk/app bundles of your app for publishing/updating purpose you have to provide a same key and password therefor it is highly recommended to store key on safe place
Note:- in some cases(if you already have multiple failed tries) you may face something like "you already have one with same version" error on play store console in that case, in build.gradle file just increment versionCode and versionName no by one and regenerate apk/app bundles
In my case, I upload the wrong application with the same name. Just make sure you upload the same applicationId than previous one.
For me, what went wrong was that, in my google play console, I had already opted in to play app signing, so when I first uploaded the aab, google registered and signed my app for subsequent releases. This means if i upload another aab, the signed certificate will be different from the one google signed.
I needed to delete this so I upload another aab. In other to do this, I had to click on my profile and select manage developer accounts. I saw the drafts of my aab google has signed, I deleted this so that I can generate and reupload another one.
When I deleted it, I then generated another aab from my android studio and uploaded it again to my google play console. This time, it did not give me the warning for wrong signing key

How to copy the debug.keystore file?

I have the same problem with Android Google Maps not working outside my computer, and in the solution, it looks like making sure everyone in my team have the same .keystore file will solve the problem. However, .keystore file is hidden, I guess it's also encrypted in some way that you can't just view it using cat command.
I am working with my teammates on a android project and I'm in charge of the map part, but no one else can see the map even if we have the exactly same codes(shared using git).
So could anyone please tell me how to copy the file to others (and is it safe to do so)?
Or is there any other ways to do this?
I use a mac, the I have teammates using windows and mac.
Option a)
You can make everyone on your team use the same signing key for debug builds.
I like this solution because when testing you can easily update already installed apps from your colleagues (because the signatures match).
1. Make a prepro keystore
Copy one of your debug keystores in your project root directory. Debug keystore is typically located in ~/.android/debug.keystore. Let's name the copy prepro.keystore.
2. Make a prepro signing config
In your app module build.gradle create a new signing config that's using the keystore from step 1.
android {
signingConfigs {
prepro {
storeFile rootProject.file("prepro.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
}
Note the passwords and key alias for all debug keystores.
3. Use the prepro signing config
Make all your debug builds use this new signing config.
android {
buildTypes {
debug {
signingConfig signingConfigs.prepro
}
}
}
Notes
You can name your new signing config anything except debug and release.
is it safe to do so
Putting a key in Git is OK as long as it's a key intended for development.
Option b)
Add your colleagues' debug key signatures to the project Google console. Then apps built by them will be able to use Google APIs such as Maps.
More info here: https://developers.google.com/maps/documentation/android-api/signup#getting-the-certificate-information-yourself
I guess it's also encrypted in some way that you can't just view it using cat command.
Correct, see the link above.

Import key store from eclipse to android studio

I made research on the topic, but couldn't find a solution:
I created a signed apk from an eclipse project, and i also have the eclipse key store.
But i couldn"t find out how to import this key store at signing in Android Studio.
These are the following things i already tried:
-adding the key store path as it was created originally by eclipse in Android Studio
-adding the path in Android Studio after adding the .jks extension to the original file
In both cases the error is:
Execution failed for task ':application:packageRelease'.
Failed to read key from keystore
So what is the correct way of adding an eclipse keystore to Android Studio?
Any suggestions appreciated, because i have no idea what goes wrong.
I believe this message means that your key alias does not exist. In Android Studio, you can use Build > Generate Signed APK..., enter your key store password, and then browse for a list of key alias in the keystore.
I had the same problem and was really frustrated with it. I have solved it and can help you with it.
1) Ensure that your key is uncorrupted and untampered. This is the reason behind most of the problems.
2) Select the path of the key in "Generate Signed APK" dialog box. This path can be anything, it doesn't actually matter.
3) Now just put your keystore password. This needs to be correct, otherwise you will get messages like "Keystore is corrupted", but it isn't.
4) After entering the password, select the Key Alias. If you enter wrong password, this field will be blank.
5) Put the Key Password same as Keystore password. This worked perfectly for me.
Hope it helps all of you. Thanks.
This is specified in your Gradle build file, copy the keystore file into your Android Studio project structure, I chose to create a new directory under app called keystores: /app/keystores/release.keystore
signingConfigs {
debug {
storeFile file('keystores/debug.keystore')
}
release {
storeFile file('keystores/release.keystore')
keyAlias ...
storePassword ...
keyPassword ...
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
debuggable true
}
release {
signingConfig signingConfigs.release
debuggable false
}
}

Categories

Resources