Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nixos android sdk license #23910

husnoo opened this issue Mar 15, 2017 · 3 comments


Copy link

commented Mar 15, 2017

Issue description


How do I accept the sdk license on nixos? Thanks!

Steps to reproduce

$ ANDROID_HOME=~/.nix-profile/libexec/ LD_LIBRARY_PATH=/nix/store/23cqmxnpr8
pdg1ivirb399g6ahh3dwlg-ncurses-5.9/lib/ gradle build
You have not accepted the license agreements of the following SDK components:
  [Android SDK Platform 25].
  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.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to

Technical details

  • System: (NixOS: nixos-version, Ubuntu/Fedora: lsb_release -a, ...)
  • Nix version: (run nix-env --version)
  • Nixpkgs version: (run nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)

This comment has been minimized.

Copy link

commented Jun 8, 2017

Running into the same problem trying to build a react-native project on NixOS. In an imperative world, we could just run this:

yes | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-25"

However, this fails because /nix/store is not writable

I have read elsewhere, that the ANDROID_HOME should be set to a directory in $HOME to allow the SDK to manage its software on its own, but I'm not sure how to work with that setup exactly.


This comment has been minimized.

Copy link

commented Jun 12, 2017

This is not a solution, but I hacked my way though a setup that at least lets me get work done in react-native for now, and maybe it will unblock someone else until the right way to do this is shared/documented/fixed:


This comment has been minimized.

Copy link

commented Aug 17, 2017

I see many Travis-CI scripts just do

mkdir -p "$ANDROID_SDK/licenses"
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_SDK/licenses/android-sdk-license"
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_SDK/licenses/android-sdk-preview-license"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.