我是按照指示部署一个颤振应用到游戏商店。https://flutter.dev/docs/deployment/android
我已经达到了主题--创造一个关键
提示我输入密码、姓名等,并通过该过程中的所有步骤,直到我说“是”,然后收到以下错误
[Storing ~/key.jks]
keytool error: java.io.FileNotFoundException: ~\key.jks (The system cannot find the path specified)
java.io.FileNotFoundException: ~\key.jks (The system cannot find the path specified)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
at sun.security.tools.keytool.Main.doCommands(Main.java:1144)
at sun.security.tools.keytool.Main.run(Main.java:343)
at sun.security.tools.keytool.Main.main(Main.java:336)我不知道该怎么绕过这件事。
我尝试使用以下每个命令:"C:\Program \Android\jre\bin\keytool“-genkey -v -keystore ~/key.jks -keyalg -keysize 2048 -validity 10000 -alias key
这一次会导致上述错误。
我也尝试过:"C:\Program \Java\jre-10.0.1\bin\keytool“-genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
这个错误导致以下错误:
[Storing ~/key.jks]
keytool error: java.io.FileNotFoundException: ~\key.jks (The system cannot find the path specified)
java.io.FileNotFoundException: ~\key.jks (The system cannot find the path specified)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(Unknown Source)
at java.base/java.io.FileOutputStream.<init>(Unknown Source)
at java.base/java.io.FileOutputStream.<init>(Unknown Source)
at java.base/sun.security.tools.keytool.Main.doCommands(Unknown Source)
at java.base/sun.security.tools.keytool.Main.run(Unknown Source)
at java.base/sun.security.tools.keytool.Main.main(Unknown Source)我还尝试将这些目录中的每一个添加到path中,而不是发出docs: keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias密钥中列出的命令。
但这给了我一个错误:“keytool”不被识别为内部或外部命令,
以前有人遇到过这种情况吗?
发布于 2019-04-03 12:31:35
在Linux和MacOS中,'~‘是"my home目录“的快捷方式,因此~/key.jks扩展到例如/home/fluttercoder/key.jks。显然,Windows上不存在此文件夹。
在Windows上选择一个不同的文件夹,例如c:\Users\fluttercoder\keys\,这样文件就变成了c:\Users\fluttercoder\keys\key.jks。(请注意任何带有空格的Windows文件夹。最好避开它们,否则用双引号括起来。)
发布于 2019-04-03 12:37:54
根据我的理解,您需要创建keystore(.jks)文件。
或
只需在命令行下面放置正确的路径即可
密钥工具-genkey -v -keystore -keyalg RSA -keysize 2048 -validity 10000 -alias密钥
:)
https://stackoverflow.com/questions/55494785
复制相似问题