Generate signed apk android studio

后端 未结 9 2150
花落未央
花落未央 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:18

    you can add this to your build gradel

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

    if you then need a keyHash do like this via android stdio terminal on project root folder

    keytool -exportcert -alias my.keystore -keystore app/my.keystore.jks | openssl sha1 -binary | openssl base64
    

提交回复
热议问题