Error Command failed gradlew.bat

Cara mudah mengatasi error pada react native. Yaitu error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.

Terdapat Error
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

Pada Project
Unable to install C:\X-Project\ReactNative\MyContactApp\android\app\build\outputs\apk\debug\app-debug.apk

Cara mengatasinya lakukan setting sebagai berikut pada emulator atau real devices :

1. Developer Options
Error Command failed gradlew.bat

2. USB debugging turned on dan Install via USB turned on
Error Command failed gradlew.bat
3. Verify apps over USB turned on
Error Command failed gradlew.bat

4. Tap Reset to default values
Error Command failed gradlew.bat

5. MIUI optimization turned off
Error Command failed gradlew.bat