Homebrew-cask: Having Error when trying to brew cask install android-sdk on mac os x

Created on 9 Apr 2017  路  12Comments  路  Source: Homebrew/homebrew-cask

General troubleshooting steps

Description of issue

Tried to run:
$brew cask reinstall android-sdk

After executing the command, it got to this:
==> Verifying checksum for Cask android-sdk
Error: No such file or directory - /usr/local/share/android-sdk
Follow the instructions here:
https://github.com/caskroom/homebrew-cask#reporting-bugs

Output of your command with --verbose --debug

$brew cask reinstall android-sdk --verbose --debug
==> Printing caveats
==> 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_HOME=/usr/local/share/android-sdk'

This operation may take up to 10 minutes depending on your internet connection.
Please, be patient.

==> Hbc::Installer#fetch
==> Downloading
==> Downloading https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip
Already downloaded: /Users/jackytsoi/Library/Caches/Homebrew/Cask/android-sdk--25.2.3.zip
==> Downloaded to -> /Users/jackytsoi/Library/Caches/Homebrew/Cask/android-sdk--25.2.3.zip
==> Verifying download
==> Determining which verifications to run for Cask android-sdk
==> Checking for verification class Hbc::Verify::Checksum
==> 1 verifications defined
Hbc::Verify::Checksum
==> Running verification of class Hbc::Verify::Checksum
==> Verifying checksum for Cask android-sdk
==> SHA256 checksums match
==> Hbc::Installer#uninstall
==> Un-installing artifacts
==> Determining which artifacts are present in Cask android-sdk
==> 3 artifact/s defined
#<Hbc::Artifact::PreflightBlock:0x007fa2b123d420>
#<Hbc::Artifact::Binary:0x007fa2b123d358>
#<Hbc::Artifact::PostflightBlock:0x007fa2b123d290>
==> Un-installing artifact of class Hbc::Artifact::PreflightBlock
==> Un-installing artifact of class Hbc::Artifact::Binary
==> Un-installing artifact of class Hbc::Artifact::PostflightBlock
Error: No such file or directory - /usr/local/share/android-sdk
Follow the instructions here:
  https://github.com/caskroom/homebrew-cask#reporting-bugs
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1439:in `unlink'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1439:in `block in remove_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1444:in `platform_support'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1438:in `remove_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:785:in `remove_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:563:in `block in rm'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:562:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:562:in `rm'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:57:in `block (2 levels) in load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb:35:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb:35:in `block in abstract_phase'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/set.rb:232:in `each_key'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/set.rb:232:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb:34:in `abstract_phase'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb:28:in `uninstall_phase'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:330:in `block in uninstall_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:327:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:327:in `uninstall_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:312:in `uninstall'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb:27:in `block in install_casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb:6:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb:6:in `install_casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/install.rb:10:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:115:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:158:in `process'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:169:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:169:in `rescue in process'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:149:in `process'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `<main>'

Output of brew cask doctor

$ brew cask doctor
==> Homebrew-Cask Version
Homebrew-Cask >1.1.0 (no git repository)
caskroom/homebrew-cask (git revision e2908; last commit 2017-04-09)
==> Homebrew-Cask Install Location
<NONE>
==> Homebrew-Cask Staging Location
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads
~/Library/Caches/Homebrew/Cask (1 files, 191.2MB)
==> Homebrew-Cask Taps:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask (3625 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core (0 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/cask/lib
/usr/local/Homebrew/Library/Homebrew
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin15
/Library/Ruby/Site/2.0.0/universal-darwin15
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15
==> Environment Variables
LANG="en_US.UTF-8"
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Homebrew/Library/Homebrew/shims/scm"
SHELL="/bin/bash"

Most helpful comment

@jruijgers adding the symlink sudo ln -s /usr/local/Caskroom/android-sdk /usr/local/share/android-sdk solved for me. Thanks!

All 12 comments

Hi miccal, thanks for the reply, I tried doing the things in https://github.com/caskroom/homebrew-cask/issues/31798, but I am still getting the same error...

I have the same problem. This happened after breaking a stuck process of reinstall:

$ brew cask reinstall 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_HOME=/usr/local/share/android-sdk'

This operation may take up to 10 minutes depending on your internet connection.
Please, be patient.

==> Downloading https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip
Already downloaded: ~/Library/Caches/Homebrew/Cask/android-sdk--25.2.3.zip
==> Verifying checksum for Cask android-sdk
==> Unlinking Binary '/usr/local/bin/aapt'.
==> Unlinking Binary '/usr/local/bin/aapt2'.
==> Unlinking Binary '/usr/local/bin/aidl'.
==> Unlinking Binary '/usr/local/bin/apksigner'.
==> Unlinking Binary '/usr/local/bin/dexdump'.
==> Unlinking Binary '/usr/local/bin/dx'.
==> Unlinking Binary '/usr/local/bin/llvm-rs-cc'.
==> Unlinking Binary '/usr/local/bin/zipalign'.
==> Unlinking Binary '/usr/local/bin/emulator'.
==> Unlinking Binary '/usr/local/bin/emulator-check'.
==> Unlinking Binary '/usr/local/bin/emulator64-arm'.
==> Unlinking Binary '/usr/local/bin/emulator64-mips'.
==> Unlinking Binary '/usr/local/bin/emulator64-x86'.
==> Unlinking Binary '/usr/local/bin/adb'.
==> Unlinking Binary '/usr/local/bin/dmtracedump'.
==> Unlinking Binary '/usr/local/bin/etc1tool'.
==> Unlinking Binary '/usr/local/bin/fastboot'.
==> Unlinking Binary '/usr/local/bin/hprof-conv'.
==> Unlinking Binary '/usr/local/bin/android'.
==> Unlinking Binary '/usr/local/bin/avdmanager'.
==> Unlinking Binary '/usr/local/bin/lint'.
==> Unlinking Binary '/usr/local/bin/monkeyrunner'.
==> Unlinking Binary '/usr/local/bin/sdkmanager'.
==> Unlinking Binary '/usr/local/bin/mksdcard'.
==> Unlinking Binary '/usr/local/bin/monitor'.
==> Warning: File ~/.android/repositories.cfg could not be loaded.

After some time without any output I terminated the process. Now I am getting the same error every time I try to remove or reinstall android-sdk.

Is there a way to purge remains from installation?

I am also experiencing this!

you need to create a symbolic link named android-sdk to ../Caskroom/android-sdk/<version> to be able to delete the sdk.

Also, I think the sdkmanager is updating in the background and does not provide any useful output until it is finished...

@jruijgers adding the symlink sudo ln -s /usr/local/Caskroom/android-sdk /usr/local/share/android-sdk solved for me. Thanks!

@iguatemigarin that didn't work for me.

@hamzaiftikhar did you get any conflict when creating the symlink? do tou have any log output or something?

@iguatemigarin no i didn't get any error while creating symlink

I tried this command
$ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools" "platforms;android-25" "build-tools;25.0.2" "extras;android;m2repository" "extras;google;m2repository"

and got this error, zsh: no such file or directory: /usr/local/share/android-sdk/tools/bin/sdkmanager

I am following this installation guide https://docs.nativescript.org/start/ns-setup-os-x

@hamzaiftikhar looks like your ANDROID_HOME is pointing to the wrong place, can you check that out?

See if you have the android command in your PATH and compare with ANDROID_HOME to confirm they're in the same directory

$ which android

touch ~/.android/repositories.cfg
sudo ln -s /usr/local/Caskroom/android-sdk /usr/local/share/android-sdk
Was this page helpful?
0 / 5 - 0 ratings