在TeamCity上通过gradle构建步骤构建android项目时,如何修复“ Aapt2InternalException:AAPT2”错误?

时间:2019-07-04 14:01:03

标签: android-studio gradle android-gradle teamcity

我已在PC上安装TeamCity 2019.1,以在Android项目上测试CI / CD。但是当仅在TeamCity中构建项目时,我面临以下问题:

[10:23:22]  [Step 1/3] > Task :app:mergeDebugResources FAILED
[10:23:24]  [Step 1/3] Execution failed for task ':app:mergeDebugResources'. com.android.ide.common.workers.WorkerExecutorException: 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

此问题与我的问题类似,但这种情况在Android Studio中发生了错误:[问题]:https://datatables.net/reference/api/filter()

在Android Studio中,该项目运行良好。我试图从Github检出该项目,并在gradlew clean build下运行该项目,但对我来说也很好。

遵循构建日志:

[10:23:24]  [Step 1/3] Execution failed for task ':app:mergeDebugResources'. com.android.ide.common.workers.WorkerExecutorException: 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 #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 #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 #7: 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.
[10:23:23]  [Step 1/3] 
[10:23:23]  [Step 1/3] 10 actionable tasks: 9 executed, 1 up-to-date
[10:23:24]  [Step 1/3] Process exited with code 1
[10:23:24]  [Step 1/3] Gradle failure report
[10:23:24]  [Step 1/3] Process exited with code 1 (Step: gradle-build (Gradle))
[10:23:24]  [Step 1/3] Step gradle-build (Gradle) failed

有人猜想如何解决这个问题吗?

2 个答案:

答案 0 :(得分:0)

您需要提供在构建计算机上安装的SDK的路径。

检查该主题的答案。

https://stackoverflow.com/a/56421370/4181904

答案 1 :(得分:0)

这是解决方案:

  • Ctrl + Alt + Suppr打开任务管理器

  • 杀死所有“ Java(TM)平台SE二进制文件”进程

  • react-native run-android