0

I create a new project by npx react-native init AwesomeProject and I try to start run the project by npx react-native run-android
There is error that occur

error Failed to install the app. Please accept all necessary Android SDK licenses using Android SDK Manager: "$ANDROID_HOME/tools/bin/sdkmanager --licenses".
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception. 

and

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     patcher;v4 SDK Patch Applier v4
     emulator Android Emulator
     platforms;android-30 Android SDK Platform 30
     build-tools;30.0.2 Android SDK Build-Tools 30.0.2
     tools Android SDK Tools
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
  Using Android SDK: C:\Users\user\AppData\Local\Android\Sdk\platform-tools

How should I solve this licenses issue?

Aniruddh Parihar
  • 3,072
  • 3
  • 21
  • 39
czroo
  • 157
  • 7

1 Answers1

0

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

DiveDive
  • 88
  • 5