React native - You uploaded an APK that is not signed with the upload certificate - react-native

I have uploaded an Expo project few months ago, I'm not sure I signed the app but running expo fetch:android:keystore gives me the following info:
Keystore password
Key alias
Key password
I started a new project using React Native CLI so I generated a new keystore file using the data above, but Google Play shows me that error message after I tried to upload the release APK
You uploaded an APK that is not signed with the upload certificate. You must use the same certificate. The upload certificate has fingerprint:
SHA1: XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX
and the certificate used to sign the APK you uploaded has fingerprint:
SHA1: YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY:YY
What am I doing wrong? to be honest I'm not familiar with app signing on Google Play.
How can I upload a new APK from a new RN CLI project without changing the package name and deploying a new app? I don't wanna lose my current clients.

So to anyone who will ever encounter this problem, what I did was copy the file app_name.jks from the expo project folder to android/app (RN CLI) and executed the command expo fetch:android:keystore (Expo project) to get the Keystore, Alias and Password of the Expo project.
Then changed the android/app/build.gradle (RN CLI)
signingConfigs {
release {
storeFile file('app_name.jks')
storePassword System.console().readLine("\nKeystore password: ")
keyAlias 'here is the alias from the command above`'
keyPassword System.console().readLine("\nKey password: ")
}
}
Then executed the build command ./gradlew assembleRelease --no-daemon, console log will ask for the password and the keystore password (from the expo command above) and that's it!
I was able to upload to Google Play using the same upload fingerprints

Related

How to create jks keystore file in expo react native on windows

I have created expo project now I am setting up expo credentials on expo host they asking me to upload .jks file. so my question is how can I generate it. please guide me thanks.

React Native Signed APK secure credentials

I am going to generate my APK to upload to the play store. I am following the React-Native documentation.
I want to protect my keystore password. But I use Windows (in the documentation it only appears for OSX)
I try storePassword Console.ReadLine("\n\$ Enter keystore password: ") but didn't work
I found a solution. Generate the APK from Android Studio. I Follow the steps in this tutorial
Remember choose "Generate Signed Bundle / APK" on Android Studio

how to use exist certificate to sign an apk with expo?

generate apk with the command
# expo build:android
and upload to google play console.
But it fails and says; You uploaded an APK that is not signed with the upload certificate
then what I did go to App Signing section and downloaded deloyment.cert file,
now I wonder how I can tell expo to use this file to sign and build apk file?
expo cli version 3.22.3
The hashes in keystore of # expo credentials:manager output diffirent from what it looks in store, how can I generate new keystore file to update this info?
you can run expo credentials:manager in your project directory to manage the signing credentials for your project. read more about app signing on android with expo managed projects at https://docs.expo.io/distribution/app-signing/#android

Why I have this problem with the appbundle?

I published this app on the playstore (https://play.google.com/store/apps/details?id=com.brawlcalculator) and I want to reduce the dimension of the app using an app bundle. I created the app with React Native and I used in the same project this command to create the apk(./gradlew clean && ./gradlew assembleRelease) and I successfull published it into the playstore, then I created the app bundle with this command (./gradlew bundleDebug) and when I tried to upload the appbundle it gives me an error: "The appbundle have the wrong key". Does I have to upload the apk and the appbundle together?
assembleRelease signs the APK with your release key, while bundleDebug signs the Bundle with your debug key.
Instead, you should upload the Bundle built with your release key, which you can do using the bundleRelease task.

can't upload updated react native app into play store

Yesterday I've finished and uploaded into play store a react native app (I've followed these steps).
Today I've made some changes to the app and I tried to upload into the play store the new version (I changed versionCode and versionName inside build.gradle file).
When I try to upload the new .apk file in the play store I get this error message:
You uploaded an APK that is signed with a different certificate to your previous APKs. You must use the same certificate. Your existing APKs are signed with the certificate(s) with fingerprint(s)