How to set my gradle for final release apk

前端 未结 2 1315
长发绾君心
长发绾君心 2020-12-30 09:27

Earlier my gradle was like this: WHICH IS OFCOURSE INCORRECT

    apply plugin: \'android\'

android {
    compileSdkVersion 19
    buildToo         


        
相关标签:
2条回答
  • 2020-12-30 10:09

    The comment by pyus13 is what i would go by.

    It says in the documentation (http://developer.android.com/tools/publishing/app-signing.html) that:

    "Note: Including the passwords for your release key and keystore inside the build file is not a good security practice. Alternatively...have the build process prompt you for these passwords."

    So just do Build > Generate signed apk and Android studio will prompt you for the keystore/passwords and generate the apk in release mode. No need to put passwords in build file.

    0 讨论(0)
  • 2020-12-30 10:12

    On the lower left of the Studio window there's a docked view called "Build Variants".

    Open it and choose the release variant.

    enter image description here

    ps. you are adding compile 'com.google.android.gms:play-services:+' twice.

    0 讨论(0)
提交回复
热议问题