Flutter:无法从商店读取密钥:无法恢复密钥

时间:2021-05-04 04:16:25

标签: flutter keystore android-keystore release-apk

当我尝试从 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.

我遇到了这个问题,在应用了许多解决方案后,没有一个解决方案有效,但在我的情况下,它现在仍然出现此错误

关于如何修复它的任何想法以及如何发现密码必须相同?

1 个答案:

答案 0 :(得分:1)

确保密钥库的密码与私钥匹配,并在 key.properties 文件中指定。

并确保新的密钥密码密钥存储密码相同。验证是否也在 key.properties 文件中指定了相同的密码。

就我而言,问题在于密钥存储密码密钥密码不正确。所以生成一个新的密钥,它会起作用(只需确保新的密钥密码密钥存储密码相同)