save keystore password in android studio 3

前端 未结 2 625
说谎
说谎 2021-01-30 17:19

in android studio 2 you can save key store password and key password but in android studio 3 you can just save key password and you have to write key store password every time y

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-30 17:56

    I am having the same issue. But you can add your signing configs this way so they won't be checked into version control:

    Put this into ~/.gradle/gradle.properties

    RELEASE_STORE_FILE={path to your keystore}
    RELEASE_STORE_PASSWORD=*****
    RELEASE_KEY_ALIAS=*****
    RELEASE_KEY_PASSWORD=*****
    

    Modify your build.gradle like this:

    ...    
    signingConfigs {
    
       release {
           storeFile file(RELEASE_STORE_FILE)
           storePassword RELEASE_STORE_PASSWORD
           keyAlias RELEASE_KEY_ALIAS
           keyPassword RELEASE_KEY_PASSWORD
       }
    }
    
    buildTypes {
            release {
                signingConfig signingConfigs.release
            }
    }
    

    Source: How to create a release signed apk file using Gradle?

提交回复
热议问题