您上传的 APK 不是 zip 对齐错误 [英] You uploaded an APK that is not zip aligned error
问题描述
我刚刚通过android studio完成并签署了apk,然后我通过 apkprotect.com 做了一个 apk 保护当我尝试将 APK 上传到 Play 商店时,我收到此错误您上传的 APK 未进行 zip 对齐.您需要在 APK 上运行 zip 对齐工具并再次上传."如果我上传原始 apk 就没有错误,
I have just finished and signed the apk through android studio, then I have did an apk protect through apkprotect.com when I am trying to upload the apk to play store I got this error " You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again. " if I upload the original apk I got no errors,
我试图在 build.gradle 中添加 zipalign true 但什么也没发生我也试过禁用和启用 proguard .
I have tried to add zipalign true in the build.gradle but nothing happened I have tried also disable and enable proguard .
推荐答案
您可以在命令行中手动运行 zipalign:
You can run zipalign manually in command line:
zipalign [-f] [-v] <alignment> infile.apk outfile.apk
注意 zipalign 位于 ${sdk.dir}\tools
Note that zipalign is located inside ${sdk.dir}\tools
有关详细信息,请访问 zipalign
For more details visit zipalign
[更新]
另外,如果你需要签名,你可以运行:
Also, If you need to sign it you can run:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore YOURKEYSTORE unsigned.apk alias_name
(jarsigner 位于 java JDK_HOME/bin 内)
(jarsigner is located inside java JDK_HOME/bin)
这篇关于您上传的 APK 不是 zip 对齐错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!