【问题标题】:flutter keytool : The term 'keytool' is not recognized as the name of a cmdletflutter keytool :术语“keytool”未被识别为 cmdlet 的名称
【发布时间】:2021-09-04 10:11:04
【问题描述】:

嗨,我正在尝试发布我的 Flutter 项目,所以我去创建一个密钥库我尝试了来自 Flutter dev 的这个命令
keytool -genkey -v -keystore c:\Users\USER_NAME\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload

但是我遇到了这个错误

keytool : The term 'keytool' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of    
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+   keytool -genkey -v -keystore c:\Users\USER_NAME\upload-keystore.jks ...
+   ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (keytool:String) [], CommandNotFoundException
 
keytool : The term 'keytool' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of    
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -val ...
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (keytool:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

我尝试运行 flutter doctor -v 并在 java 二进制文件后复制路径并尝试此命令

D:\Android studio\jre\bin\keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

还是一样,有什么问题吗? 提前谢谢!

【问题讨论】:

    标签: flutter android-studio dart visual-studio-code keytool


    【解决方案1】:

    您可以通过将 Java jdk 的路径添加到环境变量来解决此问题。

    完成后,您将使用 cmd 键入 de keytool。这对我有用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-12
      • 2017-12-11
      • 2021-12-09
      • 2020-02-25
      • 2020-04-17
      • 2018-09-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多