Generate Signed APK: Errors while building APK Android Studio

后端 未结 9 1979
无人共我
无人共我 2021-02-12 22:20

I am unable to generate Signed APK using minifyEnabled true and shrinkResources true

App Level : build.gradle

buildscript {
            


        
9条回答
  •  醉话见心
    2021-02-12 22:31

    If you cannot sign the apk in Android Studio, manually signed it with

    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name
    

    if you not have the key, generated it with keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

    You also can manually signed as the manual do:

    keytool -genkey -v -keystore my-release-key.jks-keyalg RSA -keysize 2048 -validity 10000 -alias app
    zipalign -v -p 4 my-app-unaligned.apk my-app.apk
    apksigner sign --ks my-release-key.jks my-app.apk
    

    check the signed apk

    apksigner verify my-app.apk
    

提交回复
热议问题