How to change SHA1 in Android application

15,123

Solution 1

Please go through this thread

This is for the app that you have updated it in play store initially and now you are going to update it.

Solution 2

I believe You are talking about app signing with Your developer key in debug mode. When its built on different PC it is signed with different key.

To avoid this You should be using key generate for project. You can generate this using keytool:

keytool - genkey -v -keystore <filename> -alias <alias> -keyalg RSA -keysize 2048 -validity <validity in days, more than 25 years>

Then use signConfig in Your build.gradle file:

android {
  signingConfigs {
                   debug {
                        storeFile file("location of your .keystore file")
                        storePassword "password for keystore"
                        keyAlias "alias of the key"
                        keyPassword "password for the key"
                  }
 }
Share:
15,123
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I change my PC and I'm trying to update my app. I download a hole code from GIT but aplications now have different SHA1. How to change it ? There is an easy way ?