2016-07-26 34 views
3

我需要我的RELEASE鍵的SHA 1指紋,據我所知,當我在Android Studio中選擇選項來生成已簽名的發行版APK,然後得到一個Keystore.jks文件時,會生成該鍵。通過以下google documentation我做了此命令keytool -exportcert -list -v \ -alias <your-key-name> -keystore <path-to-production-keystore>,但是這給了我 illegal options:/錯誤,所以我看了看周圍淨,這樣做,keytool -exportcert -alias freenthrowkey -keystore C:\Users\User\Documents\FreeNthrowkey密鑰庫文件存在但是爲空?

,這現在給我這個錯誤:keytool error: java.lang.Exception: Keystore file exists, but is empty: C:\Users\User\Documents\FreeNthrowkey

請如果有人可以幫助我,我真的很感激它。

+0

這可能對您有所幫助:http://stackoverflow.com/a/12894334/2571277 – astuter

+0

我下載的程序,它給我的鑰匙和指紋:d ,但我的谷歌登錄仍然沒有工作,但至少它解決了我這個問題。如果您將其作爲答案發布,我會接受它。 –

回答

0

使用下面的命令應該給你正確的輸出:

keytool -list -keystore .keystore 

如果你正在尋找一個特定的別名,你也可以在命令中指定它:

keytool -list -keystore .keystore -alias foo 

此外,爲了生成簽署APK我建議你使用Android工作室本身。從Android studio的Build菜單中選擇「Generate Signed APK」並按照步驟操作。它會在給定的路徑上生成正確的keystore

enter image description here

3

我有exectly同樣的問題。當您向密鑰庫文件提供路徑而不使用文件名時會出現問題。您必須使用-keystore選項之後的路徑給密鑰庫文件名。這意味着你的情況:

keytool -exportcert -alias freenthrowkey -keystore C:\Users\User\Documents\FreeNthrowkey\KEYSTOREFILENAME.jks

+1

這解決了它!問題是缺少keystore文件名! –

相關問題