Android studio ; jni.h not found

sebseb24 :

I'm trying to build a GStreamer app using Android Studio on windows using the tutorials on their website, but, as already mentioned in other questions, the tutorials are not up-to-date nor seems to work on Android Studio. I've followed the tutorial proposed by Eduardo Fernando at : Gstreamer examples in Android Studio, but it won't build since I can't manage to fix the issue of the jni.h file not found.

> Build command failed.
Error while executing process 
C:\Users\spomerleau\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd with 
arguments {NDK_PROJECT_PATH=null 

APP_BUILD_SCRIPT=C:\Users\spomerleau\Desktop\Android_GSTreamer\Premade_Test_tut5\android-tutorial-5\app\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\Users\spomerleau\Desktop\Android_GSTreamer\Premade_Test_tut5\android-tutorial-5\app\src\main\jni\Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-21 NDK_OUT=C:/Users/spomerleau/Desktop/Android_GSTreamer/Premade_Test_tut5/android-tutorial-5/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\spomerleau\Desktop\Android_GSTreamer\Premade_Test_tut5\android-tutorial-5\app\build\intermediates\ndkBuild\debug\lib C:/Users/spomerleau/Desktop/Android_GSTreamer/Premade_Test_tut5/android-tutorial-5/app/build/intermediates/ndkBuild/debug/obj/local/arm64-v8a/libtutorial-5.so}
  GStreamer      : [GEN] => gst-build-arm64-v8a/gstreamer_android.c
  GStreamer      : [COMPILE] => gst-build-arm64-v8a/gstreamer_android.c
  gst-build-arm64-v8a/gstreamer_android.c:1:10: fatal error: 'jni.h' file not found
  #include <jni.h>
           ^~~~~~~
  1 error generated.
  make: *** [gst-build-arm64-v8a/gstreamer_android.o] Error 1

I executed the javah command, but the generated .h cannot find the #include either.

I tried the ndk-build command, but it will stop saying the jni.h file is missing.

Any advices on how I could link the jni.h file to the project?

ystreet00 :

This is potentially a problem with the r16 changes in the Android NDK which are fixed upstream by the following commit

The problem is that the NDK moved the header files around into a unified structure and thus broke any user expecting headers in the old locations.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=431642&siteId=1