0

i'm trying to create a new app with react native. i was using android studio emulator and now i installed genymotion. whatever when i started the app i encounted an error. react native version is 0.69.4.

> Task :app:installDebug FAILED
Skipping device 'Custom - 4.4.4' for 'app:debug': minSdkVersion [21] > deviceApiLevel [19]

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
147 actionable tasks: 2 executed, 145 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to install on any devices.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BU?LD FAILED in 31s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to install on any devices.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BU?LD FAILED in 31s

    at makeError (C:\Users\Egehan Berker\Desktop\poemtra\poemtra\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
    at C:\Users\Egehan Berker\Desktop\poemtra\poemtra\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (C:\Users\Egehan Berker\Desktop\poemtra\poemtra\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (C:\Users\Egehan Berker\Desktop\poemtra\poemtra\node_modules\@react-native-community\cli\build\index.js:192:9)

min sdk version is 21 and compileSdkVersion is 31. what should i do?

ba_rt
  • 85
  • 2
  • 9

1 Answers1

1

The minSdkVersion of your app is API Level 21 ( Android 5.0 ). It caused an error because you are trying to install the app on a device with API Level 19 (Andriod 4.4.4)

You can try to lower your minSdkVersion to API Level 19 (Android 4.4.4) on android/build.gradle or install your app on the emulator Android > 5.0.

NamTran
  • 336
  • 3
  • 4