Generate signed apk android studio

后端 未结 9 2118
花落未央
花落未央 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
    
    0 讨论(0)
  • 2020-11-29 19:19

    I dont think anyone has answered the question correctly.So, for anyone else who has the same question, this should help :

    Step 1 Go to Build>Generate Signed APK>Next (module selected would be your module , most often called "app")

    Step 2 Click on create new

    Step 3 Basically, fill in the form with the required details. The confusing bit it is where it asks for a Key Store Path. Click on the icon on the right with the 3 dots ("..."), which will open up a navigator window asking you to navigate and select a .jks file.Navigate to a folder where you want your keystore file saved and then at the File Name box at the bottom of that window, simply enter a name of your liking and the OK button will be clickable now. What is happening is that the window isnt really asking you chose a .jks file but rather it wants you to give it the location and name that you want it to have.

    Step 4 Click on Next and then select Release and Voila ! you are done.

    0 讨论(0)
  • 2020-11-29 19:19
    1. Go to Build -> Generate Signed APK in Android Studio.
    2. In the new window appeared, click on Create new... button.
    3. Next enter details as like shown below and click OK -> Next.
    4. Select the Build Type as release and click Finish button.
    5. Wait until APK generated successfully message is displayed as like shown below.
    6. Click on Show in Explorer to see the signed APK file.

    For more details go to this link.

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