React Native: Please accept all necessary Android SDK licenses…

Last updated on August 24, 2021 A Goodman Loading... 9 comments

This short article shows you how to fix an error that often happens when working with React Native.

The Problem

When trying to run a React Native app on a virtual Android device with the following:

npm run Android

You may face this error:

error Failed to install the app. Please accept all necessary Android SDK licenses using Android SDK Manager: “$ANDROID_HOME/tools/bin/sdkmanager –licenses”.

Solutions

There is a couple of different ways to get rid of the annoying error. If the first one doesn’t work as expected, you can try the other one.

Using Command Line

To solve the problem, you need to accept all required Android SDK licenses. Just execute one of the following commands.

Windows:

cmd.exe /C"%ANDROID_HOME%\tools\bin\sdkmanager.bat --licenses" 

macOS

yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses

The process might take a few seconds to complete. When it’s done, you’ll see something similar to this:

Using Android Studio

1. Open your Android Studio and go to SDK Manager.

2. In the Android SDK section, select the SDK Tools tab then check the checkbox next to Google Play Licensing Library.

3. Click on the OK button to start installing.

What’s Next?

Together we’ve solved a problem that commonly occurs when setting up a development environment. Now it’s gone and you can continue learning more new and exciting stuff about React Native by taking a look at the following articles:

You can also check our React topic page and React Native topic page for the latest tutorials and examples.

Subscribe
Notify of
guest
9 Comments
Inline Feedbacks
View all comments
Dhanuka Lakshan
Dhanuka Lakshan
3 months ago

Great Brother..Its Working

Taras
Taras
5 months ago

After cmd.exe /C“%ANDROID_HOME%\tools\bin\sdkmanager.bat –licenses” terminal is disappearing

Omar Alkadro
Omar Alkadro
6 months ago

Thanks
I won’t forget your help!

React
React
1 year ago

Thanks

Arnab
Arnab
1 year ago

Thanks for the solution ,

Sneha
Sneha
1 year ago

it worked! Thank you.

Related Articles