gpt4 book ai didi

android - brew cask 安装 android-sdk

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:26:27 27 4
gpt4 key购买 nike

我在 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 或更高版本的稳定官方版本。

  • 转到 Java SE 下载并单击 JDK 下载。
  • 在 Java SE 开发工具包部分,接受许可协议(protocol)并单击适用于 Mac macOS 的下载链接。
  • 等待下载完成并安装 JDK。
  • 设置 JAVA_HOME 系统环境变量。
  • 导出 JAVA_HOME=$(/usr/libexec/java_home)安装 Android SDK。

终端中运行以下命令:

  • brew cask 安装 android-sdk

接下来,运行以下命令设置ANDROID_HOME系统环境变量:

  • export ANDROID_HOME=/usr/local/share/android-sdk

注意:这是包含工具和平台工具目录的目录。此外,安装 Android SDK Platform 25、Android SDK Build-Tools 25.0.2 或更高版本、Android Support Repository、Google Repository 和您可能需要的任何其他 SDK 的所有包。您也可以使用以下命令,这将安装所有必需的包。

  • $ANDROID_HOME/tools/bin/sdkmanager

“工具” “平台工具” “平台;android-25” “构建工具;25.0.2” “extras;android;m2repository” “extras;google;m2repository”按照此处的文章设置 Android 模拟器 (AVD)

方案二

下载 Android Studio 并更新 API 级别和支持 repos 就是这样 - 对我来说一直有效 Android SDK

关于android - brew cask 安装 android-sdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46025877/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com