无法在 Mac 中访问 ndk-bundle [英] Can not access ndk-bundle in Mac
问题描述
在 Mac 中,我刚刚安装了 NDK
,它看起来安装在:/Users/${user}/library/android/sdk/ndk/20.0.5594570
一旦我尝试深入了解 ndk-build
,我收到错误:没有这样的文件或目录
我需要生成一个工具链,记得我之前是这样做的:
${NDK_HOME}/build/tools/make_standalone_toolchain.py --api 28 --arch x86_64 --install-dir NDK/x86_64
NDK_HOME
在哪里 ANDROID_HOME=/usr/local/share/android-sdk
更新
阅读
In Mac, I just installed NDK
, that looks been installed at:
/Users/${user}/library/android/sdk/ndk/20.0.5594570
Once I tried to go deeper inside the ndk-build
I get the error:no such file or directory
I need to generate a toolchain, and remember I did it before as:
${NDK_HOME}/build/tools/make_standalone_toolchain.py --api 28 --arch x86_64 --install-dir NDK/x86_64
Where NDK_HOME
was ANDROID_HOME=/usr/local/share/android-sdk
UPDATE
Reading this, I changed the NDK_HOME
to be /Users/hasan/Library/Android/sdk/ndk/20.0.5594570/
and run the command as:
hasan$ ${NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/clang++ -target armv7a-linux-androideabi NDK/armv7a
But got the same error:
-bash: /Users/hasan/Library/Android/sdk/ndk/20.0.5594570//toolchains/llvm/prebuilt/darwin-x86_64/clang++: No such file or directory
It looks with NDK19+ the linker are coming prebuilt, and can be accessed as:
[target.x86_64-linux-android]
ar = "/Users/hajsf/Library/Android/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/darwin-x86_64/bin/x86_64-linux-android-ar"
linker = "/Users/hajsf/Library/Android/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/darwin-x86_64/bin/x86_64-linux-android23-clang"
where the linker should include the minSdkVersion
for example x86_64-linux-android23-clang
means minSdkVersion
is API 23
Note: NDK can be downloaded from https://dl.google.com/android/repository/android-ndk-r21-darwin-x86_64.zip, or can be installed from Android Studio, and it will be added to SDK path: /Users/hasan/Library/Android/sdk
这篇关于无法在 Mac 中访问 ndk-bundle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!