我遵循了 Flutter 官方网站上的所有步骤,并认为我已正确完成所有操作,但在构建它时无法找到 keystore 文件。
这是我收到的错误消息,显示它采用了错误的路径而不是
D:\flutterapps\testapp\key.jks
:
PS D:\flutterapps\testapp> flutter build apk
Initializing gradle... 1.3s
Resolving dependencies... 4.3s
Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'D:\flutterapps\testapp\android\app\ D: lutterappspublishkey.jks' not found for signing config 'release'.
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
Gradle task 'assembleRelease'... Done 5.3s
Gradle task assembleRelease failed with exit code 1
PS D:\flutterapps\testapp>
最佳答案
在 Windows 上,您必须使用 2 个反斜杠来表示路径分隔。
在你的 key.properties
中,你应该有这样的东西:
storeFile=D:\\flutterapps\\testapp\\key.jks
您不需要将您的 key.jks
文件复制到您的 flutter 项目中。
关于dart - Flutter 选择错误的 Keystore 路径并给出错误 key.jks not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53973333/