gpt4 book ai didi

android - 在 ARM64 上构建 Android 应用程序时出现 AAPT2 错误

转载 作者:行者123 更新时间:2023-12-05 00:02:06 26 4
gpt4 key购买 nike

我在基于 ARM64 的 CPU (Oracle) 上有一个 Drone.io 构建 CI/CD,在 Docker 中我有 Java 11 和来自 Google 的最新命令行工具。
当我运行命令时: ./gradlew assembleRelease 我收到 AAPT2 错误:

AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 1: ELF: not found
AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 3: y?: not found
AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 1: Syntax error: word unexpected (expecting ")")
AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 1: cannot open l: No such file
AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 1: yP?tdppp: not found
AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 3: K??H??H??HH=JH]JH]JR?td??H??H??H@qa: not found
AAPT2 aapt2-7.0.4-7396180-linux Daemon #1: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 1: ELF: not found
AAPT2 aapt2-7.0.4-7396180-linux Daemon #1: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 3: y?: not found
AAPT2 aapt2-7.0.4-7396180-linux Daemon #1: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 1: Syntax error: word unexpected (expecting ")")
AAPT2 aapt2-7.0.4-7396180-linux Daemon #1: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 1: cannot open l: No such file
AAPT2 aapt2-7.0.4-7396180-linux Daemon #1: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 1: yP?tdppp: not found
AAPT2 aapt2-7.0.4-7396180-linux Daemon #1: Unexpected error output: /drone/src/gradle_cache/caches/transforms-3/468547271df0fd777495680b526c836b/transformed/aapt2-7.0.4-7396180-linux/aapt2: 3: K??H??H??HH=JH]JH]JR?td??H??H??H@qa: not found
> Task :app:processReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
> Failed to transform appcompat-1.4.1.aar (androidx.appcompat:appcompat:1.4.1) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/19075c4677e37e538c54d7f745fc8af4/transformed/appcompat-1.4.1.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #1: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
> Failed to transform core-1.7.0.aar (androidx.core:core:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /drone/src/gradle_cache/caches/transforms-3/9339927e08badd09bc5459e4ba900d5f/transformed/core-1.7.0.
> AAPT2 aapt2-7.0.4-7396180-linux Daemon #0: Daemon startup failed
该项目在 Windows 上构建良好,我也尝试在 assembleRelease 之前运行 gradlew clean 但这也没有帮助,我已将 GRADLE_USER_HOME 设置为另一个文件夹,但也没有帮助。

最佳答案

您需要相同的 aapt2 版本,但需要另一个架构,因为 Android Studio 使用来自 aapt、aapt2 版本的 amd64

关于android - 在 ARM64 上构建 Android 应用程序时出现 AAPT2 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70801207/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com