密钥库文件不存在 [英] Keystore file doesn't exist
问题描述
我正在尝试获取 SHA1 指纹,以便获取 Google API 密钥.我在以下目录:
I'm trying to get the SHA1 fingerprint so I can get an Google API key. Im in the following directory:
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin
然后我从谷歌网站执行命令:
Then I execute the command from the google site :
keytool -list -v -keystore mystore.keystore
keytool -list -v -keystore mystore.keystore
但它给出了这个错误:
keytool error: java.lang.Exception: Keystore file does not exist: mystore.keystore
java.lang.Exception: Keystore file does not exist: mystore.keystore
at sun.security.tools.keytool.Main.doCommands(Main.java:742)
at sun.security.tools.keytool.Main.run(Main.java:340)
at sun.security.tools.keytool.Main.main(Main.java:333)
我遵循了教程,但我无法让它工作!有谁知道我做错了什么?
I followed tutorials but I can't get it to work! Does anyone know what I am doing wrong?
顺便说一句:我使用的是 Macbook Pro 和 Xamarin Studio 5.5.2.
BTW: I'm using a Macbook Pro with Xamarin Studio 5.5.2.
推荐答案
你说你正在从...运行命令
You said you are running the command from...
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin
您的密钥库文件也在该目录中吗?如果没有,则需要指定密钥库文件的路径,例如
Is your keystore file in that directory as well? If not then you need to specify the path to the keystore file, e.g.
keytool -list -v -keystore ~/somefolder/mystore.keystore
使用的密钥库应该是用于签署应用程序的密钥库.对于 Xamarin 调试版本,这将是位于 /Users/[USERNAME]/.local/share/Xamarin/Mono\ for\ Android/debug.keystore
的调试密钥库.OSX 上的命令是...
The keystore used should be the one used to sign the app. For Xamarin debug builds this will be the debug keystore located at /Users/[USERNAME]/.local/share/Xamarin/Mono\ for\ Android/debug.keystore
. The command on OSX for this would be...
keytool -list -v -keystore /Users/[USERNAME]/.local/share/Xamarin/Mono\ for\ Android/debug.keystore -alias androiddebugkey -storepass android -keypass android
或在 Windows 7 上
Or on Windows 7
keytool -list -v -keystore C:\Users\[USERNAME]\AppData\Local\Xamarin\Mono for Android\debug.keystore -alias androiddebugkey -storepass android -keypass android
这篇关于密钥库文件不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!