问题描述
当我尝试从 Android Studio 为我的 Flutter 应用程序签名但他们给我一个错误
FAILURE: Build Failed with an exception.
* What went wrong:
Execution Failed for task ':app:packageRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> com.android.ide.common.signing.KeytoolException: Failed to read key myapp from store "/Volumes/PKData/Project/myapp/android/key.jks": Cannot recover key
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
我遇到了这个问题,在应用了许多解决方案后,没有一个解决方案有效,但在我的情况下,它现在仍然出现此错误
关于如何修复它的任何想法以及如何发现密码必须相同?
解决方法
确保密钥库的密码与私钥匹配,并在 key.properties 文件中指定。
并确保新的密钥密码与密钥存储密码相同。验证是否也在 key.properties 文件中指定了相同的密码。
就我而言,问题在于密钥存储密码和密钥密码不正确。所以生成一个新的密钥,它会起作用(只需确保新的密钥密码与密钥存储密码相同)