Issues with Android Build and SDK Licenses

Hello! A few days ago I started having this issue: Homebrew must be run under Ruby 2.3! (RuntimeError)

I used the brew update fix that was recommended on that thread and the error stopped. With that fix my build is now failing because it says I’m not accepting Android SDK licenses:

[06:44:34]: ▸ A problem occurred configuring project ‘:app’.
[06:44:34]: ▸ > Could not resolve all dependencies for configuration ‘:app:_defaultConfigDebugApk’.
[06:44:34]: ▸ > A problem occurred configuring project ‘:tipsi-stripe’.
[06:44:34]: ▸ > You have not accepted the license agreements of the following SDK components:
[06:44:34]: ▸ [Android SDK Build-Tools 25, Android SDK Platform 25].
[06:44:34]: ▸ Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
[06:44:34]: ▸ Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
[06:44:34]: ▸ * Try:
[06:44:34]: ▸ Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[06:44:34]: ▸ BUILD FAILED

This was working without errors until I added brew update. I have a script where I’m copying the licenses folder from my sdk to my project root folder (Need to accept license agreement for Android tools?) and this script and config have been working fine for a long time, until now.

I just can’t figure out what I’m doing wrong. Any idea would be highly appreciated. Thanks!

Hi santorovich,

Google have updated some licenses yesteday, that has been causing these issues. Are you building on macOS with CircleCI 1.0?

Running a command like this before you build your project should fix the problem:

 yes | sdkmanager --licenses

Thanks,

Marc

Amazing! Thanks @marc! That was exactly the issue. Didn’t know Google updated some licenses yesterday.

1 Like