React Native: Please accept all necessary Android SDK licenses…

Updated: June 27, 2022 By: A Goodman 10 comments

This short and straightforward 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
10 Comments
Inline Feedbacks
View all comments
Srinivas ML
Srinivas ML
2 years ago

Thanks, it’s working

Dhanuka Lakshan
Dhanuka Lakshan
2 years ago

Great Brother..Its Working

Taras
Taras
2 years ago

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

Omar Alkadro
Omar Alkadro
3 years ago

Thanks
I won’t forget your help!

React
React
3 years ago

Thanks

Arnab
Arnab
3 years ago

Thanks for the solution ,

Sneha
Sneha
3 years ago

it worked! Thank you.

Related Articles