Xamarin 葫芦android内置Mac giving[Error]找不到android SDK,请确保已安装

Xamarin 葫芦android内置Mac giving[Error]找不到android SDK,请确保已安装,xamarin,calabash,calabash-android,xamarin-test-cloud,Xamarin,Calabash,Calabash Android,Xamarin Test Cloud,我正试图在我的mac上构建葫芦安卓系统,我得到了以下错误 sudo calabash-android build /Users/igate/Downloads/SimpleCreditCardValidator/app/app-release.apk ERROR: Could not find an Android SDK please make sure it is installed. ERROR: You can read about how Calabash is searching f

我正试图在我的mac上构建葫芦安卓系统,我得到了以下错误

sudo calabash-android build /Users/igate/Downloads/SimpleCreditCardValidator/app/app-release.apk
ERROR: Could not find an Android SDK please make sure it is installed.
ERROR: You can read about how Calabash is searching for an Android SDK and how you can help here:
ERROR: https://github.com/calabash/calabash-android/blob/master/documentation/installation.md#prerequisites
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.8.0/lib/calabash-android/dependencies.rb:114:in `setup': Could not find an Android SDK (RuntimeError)
    from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.8.0/lib/calabash-android/dependencies.rb:41:in `java_dependencies'
    from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.8.0/lib/calabash-android/dependencies.rb:81:in `keytool_path'
    from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.8.0/lib/calabash-android/helpers.rb:186:in `block (2 levels) in fingerprint_from_apk'
    from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.8.0/lib/calabash-android/helpers.rb:169:in `chdir'
    from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.8.0/lib/calabash-android/helpers.rb:169:in `block in fingerprint_from_apk'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:88:in `mktmpdir'
    from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.8.0/lib/calabash-android/helpers.rb:168:in `fingerprint_from_apk'
    from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.8.0/bin/calabash-android-build.rb:2:in `calabash_build'
    from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.8.0/bin/calabash-android:71:in `<top (required)>'
    from /usr/bin/calabash-android:23:in `load'
    from /usr/bin/calabash-android:23:in `<main>'
如上所述,在安装或使用gems时,您都不应使用sudo:

你不应该用sudo安装gems。如果你有问题 安装bundler时,建议使用葫芦沙箱或使用 Ruby的托管版本,例如rbenv或rvm

此外,回到Android SDK,确保您从下载了正确的SDK,将文件解压缩到您想要的任何位置,并将正确的路径插入到您的.bash_配置文件中

例如,这些是地雷(我已将文件夹解压缩到~/Documents中):

它就像一个符咒一样工作

正如上面所建议的,在安装或使用gems时都不应该使用sudo:

你不应该用sudo安装gems。如果你有问题 安装bundler时,建议使用葫芦沙箱或使用 Ruby的托管版本,例如rbenv或rvm

此外,回到Android SDK,确保您从下载了正确的SDK,将文件解压缩到您想要的任何位置,并将正确的路径插入到您的.bash_配置文件中

例如,这些是地雷(我已将文件夹解压缩到~/Documents中):


它就像一个符咒

使用-v标志运行它,您可以准确地看到哪些失败使用-v标志运行它,您可以准确地看到哪些失败
export ANDROID_HOME="/Users/igate/Library/Android/sdk"
export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
export ANDROID_HOME="$HOME/Documents/android-sdk-macosx"
export ANDROID_SDK_ROOT="$ANDROID_HOME"