2

While trying to install android-platform-tools using homebrew on OS X 10.11.6, I encountered the following error (complete paste below):

$ brew cask install android-platform-tools
==> Satisfying dependencies
==> Downloading https://dl.google.com/android/repository/platform-tools_r28.0.1-
######################################################################## 100.0% /usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: error: 'quarantinePropertiesKey' is only available on OS X 10.10 or newer
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^ /usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: note: add 'if #available' version check
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^ Error: Failed to quarantine /Users/User/Library/Caches/Homebrew/downloads/e3de3bef9f7f114325f5d2be854f297cc85e6e17a490c9f267b1c838ee225340--platform-tools_r28.0.1-darwin.zip. Here's the reason: /usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: error: 'quarantinePropertiesKey' is only available on OS X 10.10 or newer
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^ /usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: note: add 'if #available' version check
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^

This doesn't make sense to me, since this system is running OS X 10.11.x.

Do I need to completely uninstall and reinstall homebrew? I'd rather not, if possible, since I have a few things installed via homebrew currently.

I did run brew update immediately before this, so homebrew should be up to date.

4

This is due to a current bug in Homebrew, and a fix has been merged

Per issue #4809:

Hi, PR #4656 appears to break brew cask install on 10.11. I get an error on 10.11, but not on 10.12. As a workaround, re-running with the --no-quarantine flag is successful. I'm not sure why this swift feature isn't available, my OS is up to date.

(snip)

/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: error: 'quarantinePropertiesKey' is only available on OS X 10.10 or newer
      forKey: URLResourceKey.quarantinePropertiesKey

(etc)

(snip and etc mine)

This is the same issue you are facing.

There is a PR (#4796) that addresses this, which has been merged into master as of a day ago (2018-09-06):

The Gatekeeper API I've written relies on an up-to-date CLT (or Xcode) install, and xattr's -r flag for native recursion. There are cases where Swift is too old or is set to a deployment target earlier than MacOS 10.10, and thus cannot use the URLResourceKey.quarantinePropertiesKey constant. And in the current Mojave beta, xattr does not have Apple's -r extension for doing native filesystem traversal.

This pull request inserts an additional check in the Swift script, the Quarantine.available? function and brew cask doctor, and changes propagate to use xargs for recursion.

The latest release of brew at time of writing is 1.7.3, released on September 3rd.

Note: I just ran a brew update and it tells me I am running 1.7.3 running at commit 5d894, which was committed today (2018-09-07) and is the latest version of homebrew-core at time of writing.

Semi-workaround

If you haven't already downloaded a file, you could try with no-quarantine, ie

$ brew cask install --no-quarantine android-platform-tools

however since you already have those files they should already be quarantined, unfortunately.

  • Thanks for the issue/PR find. Interestingly, I was able to workaround using --no-quarantine, even though I had already tried the installation unsuccessfully. (Very odd.) brew -v shows I'm on the same version and commit as you - I wonder why the issue manifested itself...(?) – user3.1415927 Sep 7 '18 at 17:09
  • Hmm, bit of a puzzler! Not sure why it would manifest itself but at least you were able to work around :) – bertieb Sep 10 '18 at 7:17
  • Okay, I thought that this would be solved after an update of homebrew, but it isn't. I'm currently on 1.7.3, commit ce9cf9, and I received the exact same error when I tried brew cask install java. Is this pull/update supposed to fix the error, or do I need to continue using the --no-quarantine flag? – user3.1415927 Sep 10 '18 at 14:08

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.