Generate signed apk android studio

后端 未结 9 2149
花落未央
花落未央 2020-11-29 18:15

I am new to android development and just finished my first app. I want to generate a signed apk in android studio. I read the developer docs but couldn\'t understand the ste

9条回答
  •  悲哀的现实
    2020-11-29 19:00

    The "official" way to configure the build.gradle file as recommended by Google is explained here.

    Basically, you add a signingConfig, in where you specify the location an password of the keystore. Then, in the release build type, refer to that signing configuration.

    ...
    android {
        ...
        defaultConfig { ... }
        signingConfigs {
            release {
                storeFile file("myreleasekey.keystore")
                storePassword "password"
                keyAlias "MyReleaseKey"
                keyPassword "password"
            }
        }
        buildTypes {
            release {
                ...
                signingConfig signingConfigs.release
            }
        }
    }
    ...
    

提交回复
热议问题