![](/img/trans.png)
[英]React Native - Execution failed for task ':app:installDebug'
[英]React Native Task :app:installDebug FAILED
我正在尝试使用本机反应创建一个新应用程序。 我正在使用 android 工作室模拟器,现在我安装了 genymotion。 无论何时启动应用程序,我都遇到了错误。 反应原生版本是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)
最小 sdk 版本为21
, compileSdkVersion
为31
。 我应该怎么办?
您的应用程序的 minSdkVersion 是 API 级别 21 ( Android 5.0 )。 它导致了错误,因为您尝试在 API 级别 19 (Andriod 4.4.4) 的设备上安装应用程序
您可以尝试在android/build.gradle
您的 minSdkVersion 降低到 API 级别 19 (Android 4.4.4) 或在模拟器 Android > 5.0 上安装您的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.