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

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 app:installDebug -PreactNativeDevServerPort=8081 You have to accept all license agreements for using Android SDK Manager. Navigate to the following directory and run sdkmanager with licenses as an argument. It would prompt you to accept all license agreements.  … Read more