android - apksigner, zipalign and jarsigner not working as expected
问题描述
I have created a Xamarin Form application using Visual Studio 2017 in Windows 10 and archived the android application to APK file.
When I upload the APK to Google Play console to update my existing app, it says the APK is not signed. Then I used this command to sign the APK using the same certificate
apksigner sign --ks <KEYSTORE_FILE_NAME> --ks-key-alias <ALIAS_NAME> <APK_FILE_NAME>
When I try to upload the signed APK, it says the APK is not zipaligned. Then I used this command to zipalign
zipalign -f -v 4 <OLD_APK_FILE_NAME> <NEW_APK_FILE_NAME>
When I upload the zipaligned APK to console, it says the APK is not signed. After I sign using apksigner
it says it is not zipaligned. I am keep on circulating in the same circle again and again.
Even after I zipalign the APK first and then sign, Same error messages are displaying again and again in same circle.
Even if I used jarsigner, the situation is same.
I followed the steps given here
But the APK not getting uploaded. What am I doing wrong?
Please note this is not a duplicate question.
解决方案
apksigner
要求您zipalign
在签署之前。jarsigner
要求您zipalign
在签署后。这记录在 zipalign 文档中。
推荐阅读
- xamarin - Xamarin 将分割线添加到网格中
- c# - 如何创建适合入口点的静态“主要”方法?
- javascript - 在 Angular 中从 Firebase 中检索 UID
- android-studio - 如何在不转到 xml 文件的情况下为 android studio 中的按钮提供名称和 ID?
- mysql - 触发以验证房间容量
- r - 如何计算 R 中的 ker(A) / 零空间
- vue.js - Vue Template 中的匿名函数是性能杀手吗?
- hibernate - Cascade ALL 不为儿童组合生成 id
- python - python中缺少值的统计信息
- android - 使用 OkHttp 客户端执行原始 graphQL 查询