今天在发布APK的时候,遇到很郁闷的问题,前一秒还能生成SiginedAPK,发现忘记改版本号了,改了之后,用同样的方法想生成release版本的APK,却一直报错:
image.png
Error:Execution failed for task ':app:packageRelease'.
> Failed to read key jeqee from store "F:\AndroidStudio_Work\JQVOOfficeV3\jqcompany.jks": Keystore was tampered with, or password was incorrect
jks无效
keystore 密码错误
keytool -storepasswd -keystore jqcompany.jks
修改完密码,之后又再改了回去,在框中再次输入密码,又报了另一个错误
Error:Execution failed for task ':app:packageRelease'.
> Failed to read key jeqee from store "F:\AndroidStudio_Work\JQVOOfficeV3\jqcompany.jks": Cannot recover key
然后,我尝试数了图中密码的位数,发现,框中虽然默认添了 key password, 空着 key store password,好像是告诉我,之前输入的key store password 是错误的,但其实,key password 的密码的位数不对,所以是 key password 是错误的,原因可能是 后面多了空格或者换行符(拷贝进去的,肯能字符编码不一样),填上正确的之后,就没有问题了。