Sign Android APK with a certificate that expires further in to the future

廉价感情. 提交于 2019-11-28 01:14:17

Set expiration to be greater than 50 years.

-validity 20000

Important Note: Don't attempt to use a purchased code signing Certificate!

If you come from the Windows app/application development world it is natural to assume that you want to use a purchased code signing certificate.

That is possible but when you or your client attempts to submit the application to the Google play store it will fail with the 'APK signed with a certificate that expires too soon' error. That is because the max validity of most purchased certificates is around 2/3 years.

The solution is to just generate your own certificate as explained by others. I picked a validity of 100 years and it worked just fine. I am pretty sure I won't be working on this app in 100 years.

The disconnect is because the certificates are used in a different way and for a different purpose. Rather then identifying and naming the developer, the self generated certificate is used to ensure that two application versions came from the same but unnamed source.

The full details can be found in: https://developer.android.com/studio/publish/app-signing.html

try to use that:
keytool.exe -genkey -v -keystore release.keystore -alias TicTacToe -keyalg RSA -keysize 2048 -validity 20000

If you work with Flash Builder and you are getting this message when uploading to the Play Store, make sure you upload an .apk generated by going to Project > Export Release Build... instead of a normal .apk generated by a run of your project.

I had generated a correct certificate but I still got the same error message until I did this. Just in case somebody has the same problem...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!