Kinda Code
Home/React Native/React Native: Please accept all necessary Android SDK licenses…

React Native: Please accept all necessary Android SDK licenses…

Last updated: June 27, 2022

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.

Related Articles