Issue
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
Solution
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
Answered By - Hasan A Yousef
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.