Reputation: 71
While running the sample NDK program Native Audio in Android studio in Arch Linux I get the following error:
Error:Execution failed for task ':app:compileNative-audio-jniArmeabi-v7aDebugSharedLibraryNative-audio-jniMainC'.
No tool chain is available to build for platform 'armeabi-v7a': - Tool chain 'ndk-clang' (Clang): Could not determine Clang version: failed to execute clang -dM -E -.
How can I correct this error? Do I need to make a tool chain so that i can run the sample ndk program?
Upvotes: 3
Views: 1753
Reputation: 11
The reason could be in absence of some library required by ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang. Like:
error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
Try to run it, check the error and install all the requirements.
For example, on Fedora it would be sudo dnf install ncurses-compat-libs for that particular library.
Upvotes: 0
Reputation: 71
Two solutions:
1) download ndk-r12 from https://github.com/android-ndk/ndk/wiki, scroll down to "current beta release", and point your android studio to use that version from native-audio/local.properties file
2) use your current ndk as-is, but comment out the following from native-audio/app/build.gradle
toolchain = 'clang'
then it will use gcc to build
Thanks to ggfan for answering this question in github
Upvotes: 1