2

I am trying to run react-native run-android and I get this error message:

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

    You have not accepted the license agreements of the following SDK components: [Android SDK Platform 23, Android SDK Build-Tools 26.0.2]. 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

I tried going to the link provided which redirected me to a more current link provided which instructed me to go to Tools > Android > SDK Manager. I did not find that in the current project I am working on: And you can see for yourself:

enter image description here

So I decided to open a brand new project and I did find the SDK Manager:

enter image description here

Where in there is there a box to tick off license agreements? I could not locate one.

I have also tried the following:

I was able to supposedly accept licenses this way:

cd ~/Library/Android/sdk/tools/bin
➜  bin ./sdkmanager --licenses
Warning: File /Users/danale/.android/repositories.cfg could not be loaded.
All SDK package licenses accepted.======] 100% Computing updates...

When I tried running react-native run-android, I got the same error again.

So I tried it this way according to this answer (Automatically accept all SDK licences):

✗ yes | sudo ~/Library/Android/sdk/tools/bin/sdkmanager --licenses
Password:
Warning: File /var/root/.android/repositories.cfg could not be loaded.
All SDK package licenses accepted.======] 100% Computing updates...

Ran react-native run-android and continued to get the same error you see above.

I tried following Sarats answer: License for package Android SDK Platform 23 not accepted

only to be met with this error:

The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
"android" SDK commands can be translated to sdkmanager commands on a best-effort basis.
Continue? (This prompt can be suppressed with the --use-sdk-wrapper command-line argument
or by setting the USE_SDK_WRAPPER environment variable) [y/N]: /usr/local/share/android-sdk/tools/android: line 118: ${trysdkresponse,,}: bad substitution
Invalid or unsupported command "update sdk"

Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk

How can I accept these license agreements?

halfer
  • 19,824
  • 17
  • 99
  • 186
Daniel
  • 14,004
  • 16
  • 96
  • 156

1 Answers1

0

You can accept license agreements from command line. Navigate to sdkmanager. ~/Library/Android/sdk/tools/bin Than run sdkmanager ./sdkmanager --licenses and accept the licenses you need. You can read more information about sdkmanager here

Robert Hovhannisyan
  • 2,938
  • 6
  • 21
  • 43
  • I followed these instructions, in fact, I think you have provided this answer in the past. If you look in my OP, you will see where I posted how I followed your steps, only to be met with the same error when running `react-native run-android` again. – Daniel May 14 '19 at 19:16
  • In fact, just for the heck of it, I decided to execute the above command one more time, only to get this answer: `All SDK package licenses accepted.======] 100% Computing updates...`, but I am still getting the same error when I attempt to run `react-native run-android`. – Daniel May 14 '19 at 20:31
  • Honestly I find this answer here: https://github.com/oblador/react-native-vector-icons/issues/527 There are other options for this problem, I think You can find for Yourself something valuable. Good Luck :) – Robert Hovhannisyan May 15 '19 at 05:55
  • thanks, but none of that was helpful either. I tried them all. – Daniel May 15 '19 at 12:57