首页 > 解决方案 > 科尔多瓦构建错误任务:app:mergeDebugResources FAILED on linux:arm64

问题描述

我在kali linux上做了一个cordova项目(使用android中的termux在vm上运行:arm64)。当我运行cordova run browser它运行成功。但是当我运行cordova build android它时失败并出现这些错误

$ cordova build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/usr/Android-Sdk (recommended setting)
ANDROID_HOME=undefined (DEPRECATED)
Using Android SDK: /usr/Android-Sdk
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
> Task :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.0-6051327-linux Daemon #0: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.0-6051327-linux Daemon #2: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.0-6051327-linux Daemon #7: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.0-6051327-linux Daemon #5: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.0-6051327-linux Daemon #4: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.0-6051327-linux Daemon #3: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.0-6051327-linux Daemon #6: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.0-6051327-linux Daemon #1: 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 1m 8s
28 actionable tasks: 18 executed, 10 up-to-date
Command failed with exit code 1: /root/hello/platforms/android/gradlew cdvBuildDebug -b /root/hello/platforms/android/build.gradle
$

这出了什么问题;gradle 显示“gradle daemon 1 incomptible”这个设备架构问题?

科尔多瓦要求在这里输出: -

$ cordova requirements                                     
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-29,android-28
Gradle: installed /usr/gradle/bin/gradle
$ 

和 gradle -version 输出是-

$ gradle -version

------------------------------------------------------------
Gradle 6.7.1
------------------------------------------------------------

Build time:   2020-11-16 17:09:24 UTC
Revision:     2972ff02f3210d2ceed2f1ea880f026acfbab5c0

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          1.8.0_271 (Oracle Corporation 25.271-b09)
OS:           Linux 3.18.120-perf-gd85b39b aarch64
$

标签: javalinuxcordovagradleandroid-sdk-tools

解决方案


好的,我不是这方面的专家,但我遇到了类似的问题,我通过 cordova run build 打开互联网连接运行来修复它。我认为您需要互联网连接来构建科尔多瓦应用程序。


推荐阅读