keijiro / KlakNDI

NDI® plugin for Unity

Home Page:https://ndi.video

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

System.DllNotFoundException on Android build

Btk30 opened this issue · comments

Hello, first of all I am a fan of your plugin, it is very useful and you rock.

I am here for an error, I have a simple unity project with an NDI Receiver object. I made a list with all the NDI sources available, in order to click on the desired source and load it. In the unity editor it works like a charm, but when I build it on my android phone, I have the following error (Error displayed on the phone because I display if there is an error instead of the source list, hope the sreenshot works) :

Screenshot_2022-07-26-14-09-47-44_bd58012e0cf5cd7cd388adbb3f9aefcc

I looked at the code and saw that in "Config.cs", for android, the DllName is "ndi" but in "KlakNDI/Plugin/Android" the name of the lib is "libndi". I don't know if it is normal and I tried different solutions but without success.

Maybe I am doing something wrong and I will be happy to know it, thank you.

Could you provide the following information?

  • Unity version
  • Android device model name

Also could you check if the sample project (Unity projects contained in this repository) works on the device?

I don't know if it is normal

Yes, that's the library naming convention on the Android platform.

Unity version : 2021.3.4f1
Android device model name : same problem on "realme x50 pro 5G" and "Redmi note 9"

I just tried the sample and it works, so I will be investigating why my project does not.

I'm having the same issue using Unity 2021.3.6f1 and the most recent version of KlakNDI 2.0.3. I just used a simple setup of capturing my game view. I've got no idea why it won't work.

@TheGreyDiamond Are you also using Android? If you're using other platforms, please post a new issue for it.

Yeah I forgot to mention, I used android 12.

I had the same problem. I tried a lots to fixed this problem ,but failed. I consider that the problem occur in the "DllImport" this desc statements.

@888fff Could you check if the sample project (Unity projects contained in this repository) works in your case?

yes . my project is that the app use webcam to capture the video to the RT, and the RT is rendered in the UI-raw-image,then the RT will be send by NDI-Sender.
It is correct running where I played in the PC, But I switched the android, deployed my phone device, The problem occured , but the webcam and the renderer works well

@888fff Just for clarification: Does the sample project work on your phone device?

Of Course not...

@888fff Then your issue is different from this ticket: The original poster told that the sample project worked on his device. Could you create a new issue about your symptom?

The plugin is set to 64. BUT!!!!! when building for android, the compiler, by default, is set to MONO, and that has the side effect of making the build arm7 even on arm 64 platforms. Even when doing system info call, it says arm64 even though the build target is arm7.

I believe this is an oversight in how unity handles arm64 plugins when running in mono arm7 mode. Half of unity's brain thinks it is arm64 and the other half thinks it's arm7.

One solution that worked for me:

Under Project Settings->Player->Configurations

  1. Set Scripting backend to be IL2CPP
  2. Uncheck ARMv7 architecture
  3. Check ARM64 architecture

P.S. Thank you Keijiro for all of the very nice plugins.

Maybe, if you made an ARMv7 build of the plugin it would work in mono.

Hey! Thanks a lot, it accutally fixes it for me! The framerate is garbage but that is a diffrent issue.