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

Viewed 411

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.

1 Answers

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