7

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':app'.

    You have not accepted the license agreements of the following SDK components: [Android SDK Platform 23, Android SDK Build-Tools 23.0.1]. 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 http://d.android.com/r/studio-ui/export-licenses.html

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output

What do I do in such situation?

Zivanovic
  • 134
  • 1
  • 7
  • Possible duplicate of [Automatically accept all SDK licences](http://stackoverflow.com/questions/38096225/automatically-accept-all-sdk-licences) – Ivan Semkin May 21 '17 at 17:50

2 Answers2

6

If opening SDK Manager in Android Studio:

  1. Open the Android SDK Manager.

  2. Click the "SDK Tools" tab and check the "Show Package Details" checkbox at the bottom right of the screen.

  3. Check the 23.0.1 option under "Android SDK Build-Tools".

  4. Click "Apply". You should be prompted with a license agreement. Accept the license and you're done.

  5. Try rerunning your react-native app.

If not using Android Studio:

  1. Open SDK Manager in your Android SDK Folder (possibly in tools or platform-tools folder)

  2. Check the box next to "Android SDK Build-tools" where the version number is 23.0.1.

  3. Click "Install 1 package" (it may be a different number. Uncheck other boxes if you don't want to install/update anything else)

  4. You should be presented with a license agreement sometime. Accept it and let the SDK Manager install the stuff for you.

  5. Try rerunning your react-native app.

Marc
  • 483
  • 1
  • 3
  • 12
  • 9
    i've tried this many times and it didn't work. i uninstalled and reinstalled android studio and followed the instructions on the reactnative github docs to the letter. It still didnt work. i ran `sdkmanager --licenses` and followed the prompts. **It still didn't work**. I literally don't know what else to do. – Chinonso Chukwuogor Jul 06 '17 at 20:37
  • I ran into the same issue and corrected it by setting the following environment variables (per https://facebook.github.io/react-native/docs/getting-started.html): `export ANDROID_HOME=$HOME/Library/Android/sdk` `export PATH=$PATH:$ANDROID_HOME/platform-tools` – joealba Jun 05 '18 at 20:00
  • I'm following your first series of instructions but I'm never given the option to accept the license agreement. It just downloads automatically. What's going on? – Martin Erlic Jun 24 '18 at 02:49
  • @MartinErlic I don't know, Martin. I haven't used React-Native in a long time and this hasn't been an issue for me. I hope you're able to get it figured out. – Marc Jun 27 '18 at 15:07
  • Thanks for the answer. I can't believe Android Studio is such a poorly designed development environment that someone has to come to Stack Overflow to solve this trivial problem. – Leopoldo Sanczyk Feb 23 '19 at 00:19
  • There is no "SDK Tools" tab or "Android SDK Manager" in Android Studio 3.4. Please precise version when submitting answer – Fakebounce May 13 '19 at 12:20
  • 1
    @Fakebounce Yes there is. You must be missing it. This is what the window looks like after you open SDK Manager: https://www.brainbell.com/android/images/sdk-platforms.png – Marc Jul 03 '19 at 17:00
1

Try to run:

$ANDROID_HOME/tools/bin/sdkmanager --licenses

That should follow you to accepting all necessary licenses

Aliaksei
  • 1,094
  • 11
  • 20