Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate Signed APK in Android Studio

There are a few questions related to my question in Stackoverflow, such as:

How do I export a project in the Android studio?

How to create a release signed apk file using Gradle

They're good. But Still make me confused. When I selected Build->Generate signed APK in Android Studio, I got this warning message:

enter image description here

What does this mean? Does it mean I have to use gradle command line by config the build.gradle? Then what is the wizard for? If I just ignore the warning by click ok and follow the wizard to generate the apk file, I'll get error message saying the apk is in debug mode when I upload the apk to Google Play.

If I follow the instruction to setup the build.gradle like this:

 signingConfigs {

        debug {
            storeFile file("debug.keystore")
        }

        release {
            storeFile file("../key/test.keystore")
            storePassword "password"
            keyAlias "key"
            keyPassword "password"
        }
    }

    buildTypes {
        release {
            debuggable false
            signingConfig signingConfigs.release
        }
    }

And everything is file when I run ./gradlew assembleRelease in terminal.

In summary, I'm confused at:

  1. What is the purpose of "Generate signed APK" wizard if I have to setup the build.gradle
  2. How to build my application in release mode when I run "Generate signed APK"

Thank you for any suggestion.

like image 550
Bagusflyer Avatar asked Mar 13 '14 01:03

Bagusflyer


People also ask

Which file is used to generate signed APK?

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.

Where is signed APK located Android studio?

Step 1: Go to Build -> Generate Signed Bundle or APK, a pop up will arise. Choose APK in the pop-up and click on Next.

How do I publish an APK signed to Google Play?

In the menu bar, go to Build and select the option Generate Signed Bundle or APK. You will see a new popup screen where you will have two options to select, Android App Bundle and APK. The Android App Bundle is also used to upload the application to the Google Play Store we will talk about it later on.

Where is signed APK located?

In the new Android Studio, the signed apk is placed directly in the folder of module for which the apk is built.


1 Answers

In left bottom corner of Android Studio, select the Build Variances, then you can change the build mode to "release". When building in release mode, I think the "Generate Signed APK" wizard works. So just ignore the build.gradle configuration!

like image 131
Bagusflyer Avatar answered Oct 13 '22 00:10

Bagusflyer