gpt4 book ai didi

android - Bitbucket 管道 : No toolchains found in the NDK toolchains folder for ABI with prefix: aarch64-linux-android

转载 作者:IT老高 更新时间:2023-10-28 21:24:50 27 4
gpt4 key购买 nike

我是 Bitbucket Pipelines 的 CI 新手目前正在this article 的帮助下建立管道.由于此错误,我的构建失败

"No toolchains found in the NDK toolchains folder for ABI with prefix: aarch64-linux-android"

谁能帮我解决这个问题?

最佳答案

今天我遇到了和你一样的问题。我也关注了blog post你提到的。任何。我很高兴向您报告:我已修复它并找到了“解决方案”! 😄

有趣的是:解决方案如此简单。你唯一要做的就是到unset (或删除)NDK 环境变量(或目录)。

魔法线是:

- unset ANDROID_NDK_HOME

这意味着我的最终 bitbucket-pipelines.yml看起来像:

image: uber/android-build-environment:latest

pipelines:
default:
- step:
script:
- unset ANDROID_NDK_HOME
- ./ci/accept_android_license.sh
- ./gradlew :app:testDebugUnitTest

为什么它可以解决问题?

说实话。我不知道😅。但我发现 uber小号 android-build-environment install the NDK为你。

我找到了一些答案 - 例如 here - 再次单独安装 NDK。但我想到了以下问题:如果我的项目不使用 NDK,我为什么要安装/更新它?所以我尝试删除 NDK 文件夹(根据 Dockerfile 位于 /usr/local/android-ndk ),一切正常🎉。

为什么 unset然后呢?

您无法删除 android-ndk dir 因为您无权执行此操作。但是您可以从中删除内容。这就是它与 rm -rf /usr/local/android-ndk 一起使用的原因。 .但随后 - 设置为 ANDROID_NDK_HOME但是那里没有任何内容,您会收到错误消息(在构建时):

./gradlew :app:testDebugUnitTest

NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /usr/local/android-ndk.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

unset环境变量也修复了该警告。

重要:

显然这不是最好的解决方案。如果您的应用程序使用 NDK,此解决方案将无济于事。在 CI 中“从 Docker 镜像”中删除一些环境变量脚本也不是最好的解决方案。也许图像稍后需要该变量(不知道这在 Docker 中是否可行......但你知道我的意思😉)。但它会“暂时”解决问题,因为 android-build-environment没有维护(一年后没有更新)无论如何我不会花太多精力来修复图像......

Note: The link to the uber:android-build-environment GitHub page refers to a single (currently the last) commit. If someone read that in the future the link is still active and correct but maybe the master branch have changed.

关于android - Bitbucket 管道 : No toolchains found in the NDK toolchains folder for ABI with prefix: aarch64-linux-android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44079559/

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