I\'m having trouble getting my NDK to compile properly in Android Studio. Whenever I try running to compile I am getting the following error.
Error:Ex
Add the ndk path (C:\android-ndk-r10e) to the path variable's value in the environment variable(System variable) which left my "path" variable like this
Settings --> System --> Advenced System Settings --> System Variables
Then open the the command window (cmd). Enter the location of your project folder with cd commands and write "ndk-build" then press enter.
Just in case if it helps somebody else:
Giving NDK path(parent folder where ndkBuild.cmd resides) in Environment Variables also solves the problem.
Alternatively, one can follow @Hayk 's answer if you are on Linux or @Nooh 's answer for Windows.
My observation:
As, if I put direct NDK path solved my problem in Android Studio sometimes but again it failed to build and threw error and then I put path in Environment Variables and the project build successfully.
In that case for Windows one has to put *
* and for Linux environment only *
*
In android studio, File->Project Structure -> SDK Location, Set the Android NDK location for your computer.
Thanks!