Flutter – 构建应用包错误 – 算法 HmacPBESHA256 不可用

huangapple go评论94阅读模式
英文:

Flutter - Build App bundle error - Algorithm HmacPBESHA256 not available

问题

我正在尝试构建应用程序包,但我遇到了以下错误:

> 无法从存储库“/Users/giorgosbillis/development/2023/altertrip app/altertrip_app/android/app/upload-keystore.jks”读取密钥 upload:完整性检查失败:java.security.NoSuchAlgorithmException:算法 HmacPBESHA256 不可用

我已将 key.properties 文件放在 android 根目录中,将 upload-keystore.jks 文件放在 android/app 目录中。

key.properties 文件内容如下:

storePassword=s>+Ke<5N"=/2h'KJ
keyPassword=s>+Ke<5N"=/2h'KJ
keyAlias=upload
storeFile=../app/upload-keystore.jks

任何帮助将不胜感激!

谢谢!

英文:

I am trying to build app bundle but i am getting the following error:

> Failed to read key upload from store "/Users/giorgosbillis/development/2023/altertrip app/altertrip_app/android/app/upload-keystore.jks": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available

I have placed the key.properties file in the android root folder and the upload-keystore.jks in the android/app directory.

The key.properties are:

storePassword=s>+Ke<5N"=/2h'KJ
keyPassword=s>+Ke<5N"=/2h'KJ
keyAlias=upload
storeFile=../app/upload-keystore.jks

Any help would be much appreciate it!

Thanks!

答案1

得分: 1

可行的解决方案 ❇️

要解决这个错误,按照以下相当简单的步骤操作。

重新生成新的密钥库

运行以下命令以生成密钥库,如官方文档中所述。

  • 如果您使用Linux或Mac,运行 keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload -storetype JKS

  • 如果您使用Windows,运行 keytool -genkey -v -keystore %userprofile%\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload

确保您添加了 -storetype

确保您没有忘记添加 -storetype JKS 这个额外的参数。事实上,添加这个额外的参数将修复问题。

祝您编码愉快 🎉🎉🎉🎉

英文:

Working solution ❇️

To fix this error, follow these pretty simple steps.

Regenerate a new keystore

Run the command to generate a keystore as explained in the official documentation.

  • If you're on Linux or Mac, you run keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload -storetype JKS

  • If you're on windows, you run keytool -genkey -v -keystore %userprofile%\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload

Make sure you added -storetype

Make sure you did not forget to add -storetype JKS extra param. In fact, adding this extra parameter will fix the problem

Happy coding 🎉🎉🎉🎉

huangapple
  • 本文由 发表于 2023年6月8日 19:08:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76431205.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定