2016-12-29 159 views
0

這是在一個步: http://docs.ionic.io/services/auth/google-native.html是我的JAVA_HOME路徑不正確?

我試着去產生具有SH1鍵:

keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore 

我收到以下錯誤:

keytool error: java.lang.Exception: Keystore file does not exist: /Users/alex_fimm_dev/.android/debug.keystore 
java.lang.Exception: Keystore file does not exist: /Users/alex_fimm_dev/.android/debug.keystore 
    at sun.security.tools.keytool.Main.doCommands(Main.java:745) 
    at sun.security.tools.keytool.Main.run(Main.java:343) 
    at sun.security.tools.keytool.Main.main(Main.java:336) 

我懷疑的東西是錯誤的JAVA_HOME路徑?

,這裏是我的.bash_profile

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/alex_fimm_dev/Desktop/Databases/Mongo/mongodb/bin:/Users/alex_fimm_dev/Desktop/Databases/Mongo/mongodb/bin 

# Setting PATH for Python 3.5 
# The orginal version is saved in .bash_profile.pysave 
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}" 
export PATH 

# Homebrew 
export PATH=/usr/local/bin:$PATH 

export LC_ALL=en_US.UTF-8 
export LANG=en_US.UTF-8 

# android and java paths 
export JAVA_HOME=/Library/Java/Home/ 
export ANDROID_HOME=/usr/local/Cellar/android-sdk/ 
export PATH=${PATH}:/usr/local/Cellar/android-sdk/24.4.1_1/platform-tools:/usr/local/Cellar/android-sdk/24.4.1_1/tools 

如果我去了密鑰庫文件的位置:

lm5-fim4-0G3QD:~ alex_fimm_dev$ cd ~/.android/ 
lm5-fim4-0G3QD:.android alex_fimm_dev$ keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore 
Unable to locate an executable at "/Library/Java/Home/bin/bin/keytool" (-1) 
lm5-fim4-0G3QD:.android alex_fimm_dev$ 

enter image description here

回答

0

解決方案:在所有

更新路徑我的終端如:

source ~/.bash_profile 

產生.keystore這是失蹤在〜/ .android,如:

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 
0

您的Java和Android的路徑是這樣的:

ANDROID_HOME=/home/user_name/Android/Sdk

JAVA_HOME=/usr/lib/jvm/java-8-oracle

如果只需要在〜/ .bashrc中添加這些行即可文件