title: How to Setup JNI Include Path for Android Studio
body: <p>I am incoperating a JNI fuction in my Android Project however it can not resolve the header which is located at /usr/local/include/opencv2.How to direct Android Studio to look for header file over there?</p>
  
  <p>It's Android studio 3 under CentOS 7.    </p>
  
  <pre><code>Build command failed.
  Error while executing process /home/&lt;username&gt;/Android/Sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /home/&lt;username&gt;/AndroidStudioProjects/&lt;project_name&gt;/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target removebackground}
  [1/2] Building CXX object CMakeFiles/removebackground.dir/src/main/cpp/removebackground.cpp.o
  FAILED: /home/&lt;username&gt;/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++  --target=armv7-none-linux-androideabi --gcc-toolchain=/home/&lt;username&gt;/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/&lt;username&gt;/Android/Sdk/ndk-bundle/sysroot  -Dremovebackground_EXPORTS -I/home/&lt;username&gt;/opencv-android-sdk/sdk/native/jni/include -isystem /home/&lt;username&gt;/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/&lt;username&gt;/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/&lt;username&gt;/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem /home/&lt;username&gt;/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security  -frtti -fexceptions -O0 -fno-limit-debug-info  -fPIC -MD -MT CMakeFiles/removebackground.dir/src/main/cpp/removebackground.cpp.o -MF CMakeFiles/removebackground.dir/src/main/cpp/removebackground.cpp.o.d -o CMakeFiles/removebackground.dir/src/main/cpp/removebackground.cpp.o -c /home/&lt;username&gt;/AndroidStudioProjects/&lt;project_name&gt;/app/src/main/cpp/removebackground.cpp
  /home/&lt;username&gt;/AndroidStudioProjects/&lt;project_name&gt;/app/src/main/cpp/removebackground.cpp:4:10: fatal error: 'opencv2/imgcodecs.hpp' file not found
  #include &lt;opencv2/imgcodecs.hpp&gt;
           ^~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.
  </code></pre>