【发布时间】:2021-08-14 13:26:08
【问题描述】:
我的主机是 Android Galaxy Tab S4 上的 linux aarch64 机器,安装了 Termux 作为我的开发环境。 安装在 Termux 中的是 NDK v22、Clang 12.0.2、Gradle 7.1.1、android-sdk (30.0.3) 和 kotlin 1.5.21。
我用 gradle 初始化了一个新的 c++ 应用程序项目,并初始化了默认模板项目文件和目录。
当我现在尝试构建项目时,出现以下错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugCpp'.
> Error while evaluating property 'compilerVersion' of task ':app:compileDebugCpp'
> No tool chain is available to build C++ for host operating system 'Linux' architecture 'aarch64':
- Tool chain 'visualCpp' (Visual Studio):
- Visual Studio is not available on this operating system.
- Tool chain 'gcc' (GNU GCC):
- Don't know how to build for host operating system 'Linux' architecture 'aarch64'.
- Tool chain 'clang' (Clang):
- Don't know how to build for host operating system 'Linux' architecture 'aarch64'.
* 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 3s
1 actionable task: 1 executed
我的用例是构建 c++ 库,然后使用 kotlin/native 并在 gradle/kotlin/ndk 等的帮助下将所有内容集成到 apk 中作为最后一项任务。
这个错误是什么意思? 真的不支持linux aarch64主机还是我需要更改build.gradle文件中的一些配置设置?
我搜索了 gradle 文档、互联网和 kotlin/native 手册,但找不到解决方案。
提前感谢您的帮助。
【问题讨论】:
标签: android c++ kotlin gradle arm64