DllNotFound exception on Android version
Hi @mrayy ,
I'm trying to build the .so (the static also tried the shared lib) for android but I'm getting DLLNotFound exception on static build and the shared lib is not working for ARMv7 I'm getting Unable to find an entry point named 'mray_gstreamer_initialize' in 'GStreamerUnityPlugin'. PS1: I tried Mono and IL2CPP many NDK versions possible (I haven't tried ARM64). PS2: I could make it to work on windows, streaming the test video and also from one c++ windows gstream app to unity.
Here some build info:
GSTREAMER_ROOT_ANDROID=C:\gstreamer-1.0-android-universal-1.16.2\armv7
I think these are not used for android but:
GST_SDK_PATH=C:\gstreamer\1.0\x86_64\
GSTREAMER_1_0_ROOT_X86_64=
GSTREAMER_DIR=
These are on path (becuase old project that used windows opencv):
C:\gstreamer\1.0\x86_64\bin;
C:\gstreamer\1.0\x86_64\lib;
C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0;
C:\Users\felipe.chaves\Downloads\opencv4.5.3\build\install\x64\vc16\bin;
This is the NDKand SDK used on my Unity 2020.3.8f1
Android NDK: C:/NDK (ver 19.0.5232133)
Android ABI: arm64-v8a
NDK toolchain: aarch64-linux-android-clang
STL type: c++_static
Native API level: 28
Android SDK: C:/SDK (tools: 26.1.1 build tools: 28.0.3)
Unity 2020.3.8f1
I'm confused about the NDK version I should use and it's compatibility with my Unity2020.3.8f1 If I put an older NDK as it is by default NDK_TARGET_LEVEL -> "android-16", if I put this older ndk it will be compatible with my newer ndk? I'm asking this because I'm getting dllnotfoundexception so I don't have a clue about whats going on, some dll reference is missing.
APP_STL := c++_static APP_PLATFORM := $(NDK_TARGET_LEVEL) APP_ABI := armeabi-v7a NDK_TARGET_LEVEL := android-23 APP_OPTIM := release APP_BUILD_SCRIPT := Android.mk
The output of the build: C:\mrayGStreamerUnity-master\Plugin\Android\GStreamer>C:\android-ndk-r17c-windows-x86_64\android-ndk-r17c/ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application.mk Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14. GStreamer : [GEN] => gst-build-armeabi-v7a/gstreamer_android.c GStreamer : [COMPILE] => gst-build-armeabi-v7a/gstreamer_android.c GStreamer : [LINK] => gst-build-armeabi-v7a/libgstreamer_android.so Done mkdir Done cp [armeabi-v7a] Prebuilt : libgstreamer_android.so <= gst-build-armeabi-v7a/ Done rm [armeabi-v7a] Install : libgstreamer_android.so => libs/armeabi-v7a/libgstreamer_android.so
PS: I also tried NDK 18.1.5063045 and as it is on the "echo use ndk r17c to compile on windows" also tried with the version: 17.2.4988734
When compiling static lib I get: I got the same result: Autoconnected Player DllNotFoundException: GStreamerUnityPlugin
When compiling with shared lib I get:
Autoconnected Player EntryPointNotFoundException: Unable to find an entry point named 'mray_gstreamer_initialize' in 'GStreamerUnityPlugin'.
I also included it on unity just to mention:


I also tried Mono and IL2CPP on ARMv7, what am I missing?
I have a related issue in that I also get DllNotFound.

I have a few questions about how things work:
- in the head of the branch, if we change the
APP_PLATFORMorAPP_ABIinPlugin/Android/jni/Application.mkand rebuild, it generateslibs/<arch>/libGStreamerUnityPlugin.so. I assume in the OP's question above the repo version was older which is why the output islibgstreamer_android.so? - Should we choose
android-16inAPP_PLATFORMbased on this table on this page https://gstreamer.freedesktop.org/download/ for armv7?

-
how is this file moved over to the apk? I have opened the apk and it does not seem to have this so file in it, which would explain the DllNotFound message. Is there something that must be selected in the Unity editor to connect
libGStreamerUnityPlugin.soto the project and make sure it is included in the apk? I placed the files manually in the project inAssets/Pluginsas the poster above seemed to:

- Lastly, I was trying to confirm that
libGStreamerUnityPlugin.soactually contains the missing functionmray_gstreamer_initialize(), but thenmcommand did not seem to help me here...
>C:\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\arm-linux-androideabi\bin\nm.exe libGStreamerUnityPlugin.so
C:\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\arm-linux-androideabi\bin\nm.exe: libGStreamerUnityPlugin.so: no symbols
Thanks for any help!
Greetings,
I have similar problems here. Any updates or guide for newbie?
Thanks for any help!
I have previously tried to recompile this plugin. I think the reason that you are getting the EntryPointNotFoundException is because there are in total 3 plugins (.so files) that need to be manually rebuilt for all the plugins to work together.
-
Build the 1.14.5 libgstreamer_android.so gstreamer plugin using
Android.mkconfiguration under\GstreamerUnityAndroidBranch\Plugin\Android\GStreamer(This is the original gstreamer android plugin.) -
Build the [libGStreamerUnityPlugin.so] (https://github.com/keli95566/MRTunnelingPico/blob/main/MRTunnelingPico/Assets/Plugins/Android/libGStreamerUnityPlugin.so) plugin by creating a custom
Android.mkconfiguration under\GstreamerUnityAndroidBranch_ARM64\Plugin\Android. (libGStreamerUnityPlugin.socontains all the core c++ scripts that create and write to shared OpenGL Unity texture pointers, etc. ) -
Build the libRenderUnityPlugin.so Unity renderer plugin using the
Android.mkconfiguration under\GstreamerUnityAndroidBranch_ARM64\Plugin\Android\Renderer. (libRenderUnityPlugin.sois the plugin that implements the Unity native rendering interfaces provided by Unity.
I uploaded the updated version of the repository to this repository: https://github.com/keli95566/gstreamerUnityPluginAndroid It has been a year ago when I got it to work. I hope that I remember everything correctly and hope that the steps mentioned above help!
For the uploaded repository, I used the following NDK/gstreamer versions:
- Use NDK r16b
- Compile Gstreamer 1.14.5, higher versions do not work for some reason.
- I only tried to build targeting arm64 architecture.
Noticed that I tried a lot of Gstreamer version, and only 1.14.5 seems to work correctly.