$ tar xJf gstreamer-1.0-android-universal-1.16.2.tar.xz
```
-Modify the gstreamer-1.0.mk file for NDK build to prevent build error.
+Modify `gstreamer-1.0.mk` and `gstreamer_android-1.0.c.in` files for NDK build to prevent error case.
Supported target ABIs are `arm64` and `armv7`.
```
$GSTREAMER_ROOT_ANDROID/{Target-ABI}/share/gst-android/ndk-build/gstreamer-1.0.mk
+$GSTREAMER_ROOT_ANDROID/{Target-ABI}/share/gst-android/ndk-build/gstreamer_android-1.0.c.in
```
-- Add directory separator.
+- Add directory separator (gstreamer-1.0.mk)
```diff
@@ -127,2 +127,2 @@
+ $(call host-cp,$(GSTREAMER_NDK_BUILD_PATH)/$(file),$(GSTREAMER_JAVA_SRC_DIR)/org/freedesktop/gstreamer/$(file)) && ) echo Done cp
```
+- Clear exceptions for native developers (gstreamer_android-1.0.c.in)
+
+```diff
+@@ -592,9 +592,10 @@
+
+ if (!klass) {
+ __android_log_print (ANDROID_LOG_ERROR, "GStreamer",
+ "Could not retrieve class org.freedesktop.gstreamer.GStreamer");
+- return 0;
+- }
+- if ((*env)->RegisterNatives (env, klass, native_methods,
++
++ if ((*env)->ExceptionCheck (env))
++ (*env)->ExceptionClear (env);
++ } else if ((*env)->RegisterNatives (env, klass, native_methods,
+ G_N_ELEMENTS (native_methods))) {
+ __android_log_print (ANDROID_LOG_ERROR, "GStreamer",
+ "Could not register native methods for org.freedesktop.gstreamer.GStreamer");
+```
+
### Download NNStreamer source code
```bash
# Prepare native libraries and header files for C-API
unzip $nnstreamer_android_api_lib -d aar_extracted
- mkdir -p main/java/org/freedesktop
mkdir -p main/jni/nnstreamer/lib
mkdir -p main/jni/nnstreamer/include
cp -r aar_extracted/assets/* main/assets
fi
- # java, libraries and mk files
- cp -r api/src/main/java/org/freedesktop/* main/java/org/freedesktop
+ # native libraries and mk files
cp -r aar_extracted/jni/* main/jni/nnstreamer/lib
cp api/src/main/jni/*-prebuilt.mk main/jni