如何使用 Gradle 创建发布签名的 apk 文件? - How to create a release signed apk file using Gradle?

问题:

I would like to have my Gradle build to create a release signed apk file using Gradle.我想让我的 Gradle 构建使用 Gradle 创建一个发布签名的 apk 文件。

I'm not sure if the code is correct or if I'm missing a parameter when doing gradle build ?我不确定代码是否正确,或者在执行gradle build时是否缺少参数?

This is some of the code in my gradle file:这是我的 gradle 文件中的一些代码:

android {
    ...
    signingConfigs {
          release {
              storeFile file("release.keystore")
              storePassword "******"
              keyAlias "******"
              keyPassword "******"
         }
     }
}

The gradle build finishes SUCCESSFUL, and in my build/apk folder I only see the ...-release-unsigned.apk and ...-debug-unaligned.apk files. gradle 构建成功完成,在我的build/apk文件夹中,我只看到...-release-unsigned.apk...-debug-unaligned.apk文件。

Any suggestions on how to solve this?有关如何解决此问题的任何建议?


解决方案:

参考一: https://en.stackoom.com/question/1Eu8g
参考二: https://stackoom.com/question/1Eu8g
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章