Unity 3D Nuitrack SDK Android not working

Hi,
I’m trying to build and example of Nuitrack SDK on an android device, but it doesn’t work.

I can run tha app “nuitrack” installedwith the latest nuitrack.apk and it works:
I can see the camera and depth camera.
I have also a valid license for activating my Orbbec Astra Pro.

But when I compile some samples I cannot see the camera.
At first I thought it was a permissions issue but the I also created a function in c# for requesting the permissions:
camera. storage, access to location.

Now I’m getting this error in the logcat:
2023-03-29 11:00:57.088 19119-19119/com.BeniniLeonardo.TESTNuitrack I/Unity: Nuitrack callback: onInitSuccess

2023-03-29 11:00:57.167 19119-19146/com.BeniniLeonardo.TESTNuitrack D/Unity: Failed to load native plugin: Unable to lookup library path for ‘nuitrack’.
2023-03-29 11:00:57.331 19119-19146/com.BeniniLeonardo.TESTNuitrack E/Unity: Perhaps the sensor is already being used in other program. Or some unexpected error.
Does this example work? \bin\nuitrack_sample.exe.

I’m stuck on this and I don’t know how to resolve it.

Thank you
Leonardo Benini

Hello @leonardo

At first I thought it was a permissions issue but the I also created a function in c# for requesting the permissions:

The unity package already has such functions

Does the AllModulesScene scene work in the editor if you connect this sensor? If everything works fine, also try to build this scene for Android

Hi @Stepan.Reuk
thank you for your answer.

I tried the scene AllModulesScene and it’s working fine

But when I try on the actual device I got the error:

2023-03-29 11:55:36.334 4852-4869/com.BeniniLeonardo.TESTNuitrack D/Unity: Failed to load native plugin: Unable to lookup library path for ‘nuitrack’.
2023-03-29 11:55:36.482 4852-4869/com.BeniniLeonardo.TESTNuitrack E/Unity: Perhaps the sensor is already being used in other program. Or some unexpected error.
Does this example work? \bin\nuitrack_sample.exe.
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at D:/Unity/PlayGround/2023/New Nuitrack/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:95)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at D:/Unity/PlayGround/2023/New Nuitrack/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:NuitrackInit () (at D:/Unity/PlayGround/2023/New Nuitrack/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:586)
NuitrackManager:StartNuitrack () (at D:/Uni

What could it be?

Here the screenshot on actual device

When I run the nuitrack app all is working fine:

I have not solve yet this issue, @Stepan.Reuk Can you help me? Thankyou

I can try.
What are your build settings?

  • x64?
  • scripting backend il2cpp or mono?

And which apk did you install? Nuitrack_arm64.apk or Nuitrack.apk

Hello @Stepan.Reuk

What I did is to create a new project with Unity 3d v.2022.1.24
After imported the latest nuitrack unitypackage
and try to build the AllmoduleScene for Android:

I have tried various settings, mono, IL2CPP, changed the Minimum API level…
Nothing worked

The only thing that I can notice is that using the nuitrack.apk app ( that works correctly) is always asking for the permissions of both Camera RGB an Camera Depth,
instead Unity is asking only for a generic camera and only one time, then the error.

Perhaps the main error is:
2023-03-29 11:55:36.334 4852-4869/com.BeniniLeonardo.TESTNuitrack D/Unity: Failed to load native plugin: Unable to lookup library path for ‘nuitrack’.

But what library is looking for? where I can verify if is really missing?

My big question is:
Is latest Nuitrack SDK for Android working with Unity 2022.x ?
And If yes, How can I achieve this?

I can modify all parameters for build settings or other, but I can’t find any detailed instructions in the documentation.

There are some issues on the last version of the unitypackage that causes errors in Android?

Thank you
Leonardo

Usually, no additional settings are required to simply run on the device. Just import the package, add some scene and push it to the device

And yet what architectures have you chosen in the settings (send a screenshot)?

image

And what version of Nuitrack apk have you installed? Nuitrack_arm64.apk or Nuitrack.apk

If there are suspicions of compatibility. You can try Unity 2020.3.1 and the previous version of the package nuitrack-sdk/Unity3D at v0.36.5 · 3DiVi/nuitrack-sdk · GitHub

If someone encounters such a problem. It works fine if you roll back to nuitrack.apk version 0.36.7