android - 最新的 React 本机项目未在 android 中构建
问题描述
react-native 版本“0.60.3”对我不起作用。但是旧版本(例如:0.57.8)可以工作。我怎样才能让它工作?
D:\Apps\test>react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using
"--no-jetifier" flag.
Jetifier found 856 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
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.1
-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.1
-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.1
-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.1
-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.1
-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.1
-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.1
-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.1
-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 7s
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.
- 出了什么问题:任务“:app:mergeDebugResources”执行失败。
工人提出了 8 个异常: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1 -5326820-windows Daemon #0: Daemon startup failed 这在正常情况下不应该发生,请提出问题如果是的话。com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1 -5326820-windows 守护进程 #2: 守护进程启动失败 这在正常情况下不应该发生,如果发生,请提出问题。com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1 -5326820-windows 守护进程 #1: 守护进程启动失败 这在正常情况下不应该发生,如果发生,请提出问题。com.android.builder.internal.aapt.v2.Aapt2InternalException:AAPT2 aapt2-3.4.1 -5326820-windows 守护进程#3:守护进程启动失败 这在正常情况下不应该发生,如果发生,请提出问题。com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1 -5326820-windows 守护进程 #4: 守护进程启动失败 这在正常情况下不应该发生,如果发生,请提出问题。com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1 -5326820-windows 守护进程 #5: 守护进程启动失败 这在正常情况下不应该发生,如果发生,请提交问题。com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1 -5326820-windows 守护进程#6: 守护进程启动失败 这在正常情况下不应该发生,如果发生,请提出问题。com.android.builder.internal.aapt.v2.Aapt2InternalException:
解决方案
同样的情况发生在我身上。但如果你正在使用..
react-native run-android --no-jetifier.
代替react-native run-android
它将正常工作
推荐阅读
- laravel - instagram embed 不会向下滚动,直到评论部分
- caching - 分布式运行器缓存 Gitlab Runner Path = path/to/prefix
- reactjs - firebase auth lib 上缺少类型
- powerbi - 由于“无法确定表 YY 中列 XX 的单个值”,RANKX 无法正常工作
- python - 如何用基于索引的列表值替换二维数组的值
- flutter - 是否可以在不使用“小部件”的情况下使用 Statefulwidget 中另一个页面的传递数据。
- python-3.x - numpy seterrcall,如何标记导致flouting点错误的对象?
- excel - df.to_excel 创建 12MB 文件。再次打开和保存时文件突然缩小到 4.6 MB
- android - 从后台获取应用程序区域设置时会更新
- sql - 更新两个表的数据