我在Mac OS X上安装android sdk(brew cask install android-idk
)时遇到问题。我尝试将其安装为nativescript。我读过那些遇到同样问题但找不到工作解决方案的人。我试图改变java路径可能会导致问题。
这是我得到的错误:
==> Caveats
We will install android-sdk-tools, platform-tools, and build-tools for you.
You can control android sdk packages via the sdkmanager command.
You may want to add to your profile:
'export ANDROID_SDK_ROOT=/usr/local/share/android-sdk'
This operation may take up to 10 minutes depending on your internet connection.
Please, be patient.
==> Satisfying dependencies
==> Downloading https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip
Already downloaded: /Users/jhon/Library/Caches/Homebrew/Cask/android-sdk--3859397,26.0.1.zip
==> Verifying checksum for Cask android-sdk
==> Installing Cask android-sdk
==> Warning: Failed to download any source lists!
==> Warning: java.nio.file.NoSuchFileException: /Users/jhon/.android/cache/sdkbin-1_b735609c-repository2-1_xml
==> Warning: Failed to find package tools
Error: Command failed to execute!
==> Failed command:
/usr/local/Caskroom/android-sdk/3859397,26.0.1/tools/bin/sdkmanager tools platform-tools build-tools;26.0.1
==> Standard Output of failed command:
==> Standard Error of failed command:
jhon-MacBook-Pro-8:appNativescript jhon$ brew cask install android-idk --verbose --debug
Error: Cask 'android-idk' is unavailable: No Cask with this name exists.
Error: Install incomplete.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/install.rb:13:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:35:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:97:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:167:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:131:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
jhon-MacBook-Pro-8:appNativescript jhon$ brew cask install android-sdk
==> Caveats
We will install android-sdk-tools, platform-tools, and build-tools for you.
You can control android sdk packages via the sdkmanager command.
You may want to add to your profile:
'export ANDROID_SDK_ROOT=/usr/local/share/android-sdk'
This operation may take up to 10 minutes depending on your internet connection.
Please, be patient.
==> Satisfying dependencies
==> Downloading https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip
Already downloaded: /Users/jhon/Library/Caches/Homebrew/Cask/android-sdk--3859397,26.0.1.zip
==> Verifying checksum for Cask android-sdk
==> Installing Cask android-sdk
==> Warning: Failed to download any source lists!
==> Warning: java.nio.file.NoSuchFileException: /Users/jhon/.android/cache/sdkbin-1_b735609c-repository2-1_xml
==> Warning: Failed to find package tools
Error: Command failed to execute!
==> Failed command:
/usr/local/Caskroom/android-sdk/3859397,26.0.1/tools/bin/sdkmanager tools platform-tools build-tools;26.0.1
==> Standard Output of failed command:
==> Standard Error of failed command:
Warning: Failed to download any source lists!
Warning: java.nio.file.NoSuchFileException: /Users/jhon/.android/cache/sdkbin-1_b735609c-repository2-1_xml
Warning: Failed to find package tools
==> Exit status of failed command:
#<Process::Status: pid 35477 exit 1>
Error: Install incomplete.
jhon-MacBook-Pro-8:appNatives
这是文档说的,你可以尝试一下 -
解决方案1 -
安装Android开发的依赖项。
安装JDK 8或更高版本的稳定版。
在Terminal
中运行以下命令:
brew cask install android-sdk
接下来,运行以下命令来设置ANDROID_HOME
系统环境变量:
export ANDROID_HOME=/usr/local/share/android-sdk
注意:这是包含工具和platform-tools目录的目录。此外,安装Android SDK Platform 25,Android SDK Build-Tools 25.0.2或更高版本,Android支持存储库,Google存储库以及您可能需要的任何其他SDK的所有软件包。您也可以使用以下命令,该命令将安装所有必需的包。
$ANDROID_HOME/tools/bin/sdkmanager
“tools”“platform-tools”“platform; android-25”“build-tools; 25.0.2”“extras; android; m2repository”“extras; google; m2repository”通过以下文章设置Android Emulators(AVD)
要么
解决方案2
下载Android Studio并更新API级别并支持repos就是这样 - 一直为我工作Android SDK