我已按照说明进行操作,但出现此消息
keytool error: java.io.FileNotFoundException: %userprofile%\upload-keystore.jks (The system cannot find the path specified)ecified)
java.io.FileNotFoundException: %userprofile%\upload-keystore.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:1194)
at sun.security.tools.keytool.Main.run(Main.java:366)
at sun.security.tools.keytool.Main.main(Main.java:359)
我制作密钥库的步骤:
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]:
What is the name of your organizational unit?
[Unknown]:
What is the name of your organization?
[Unknown]:
What is the name of your City or Locality?
[Unknown]:
What is the name of your State or Province?
[Unknown]:
What is the two-letter country code for this unit?
[Unknown]:
Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?
[no]: yes
Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
for: CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown
Enter key password for <upload>
(RETURN if same as keystore password):
然后出现上面的消息。我也找不到密钥库的文件位置。是因为它还没有创建吗?
在项目终端中运行此命令
keytool -genkey -v -keystore C:\Users\Administrator\keystore\AppName-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload
C:\Users\Administrator\keystore\
此处输入您保存密钥库文件的文件夹路径
运行:
keytool -genkey -v -keystore C:\location_of_your_project\your_project\android\app\upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload