我一直试图通过“ react-native run-android”运行我的React Native项目,但是每次遇到以下错误时 我尝试了几种方法来解决此问题,包括清除gradlew,但它们没有起作用,问题仍然存在 我已经为这个问题苦苦挣扎了十多天 这里有人知道如何解决这个问题吗?
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\myuser\AndroidStudioProjects\main>react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using
"--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 2 workers...
info Starting JS server...
info Installing the app...
> Task :**app:mergeDebugResources FAILED**
10 actionable tasks: 3 executed, 7 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
**Execution failed for task ':app:mergeDebugResources'.**
> 8 exceptions were raised by workers:
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #1: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #2: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #3: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #4: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #5: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #6: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #7: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
* 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
BUILD FAILED in 8s
error Failed to install the app. Make sure you have the Android development envi
ronment set up: https://facebook.github.io/react-native/docs/getting-started.htm
l#android-development-environment. Run CLI with --verbose flag for more details.
Error: **Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8**
081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> 8 exceptions were raised by workers:
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #1: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #2: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #3: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #4: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #5: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #6: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2
-5326820-windows Daemon #7: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it
does.
* 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
BUILD FAILED in 8s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\Users\myuser\AndroidStudioProjects\main\node_modules\
@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllD
evices.js:94:39)
at buildAndRun (C:\Users\myuser\AndroidStudioProjects\main\node_modules\@rea
ct-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:
41)
at C:\Users\myuser\AndroidStudioProjects\main\node_modules\@react-native-com
munity\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\Users\TORANJ\AndroidStudioProjects\main\no
de_modules\react-native\node_modules\@react-native-community\cli\build\index.js:
164:9)