Magic Leap 2 Missing DLL | Unity 3d

Give us as much detail as possible regarding the issue you're experiencing.

Unity Editor version: 2022.3.4f1
ML2 OS version: 1.1.0
MLSDK version: 1.3.0
Host OS: (Windows)

Error messages from logs:

**Message 1** :
Error: MLMediaPlayerCreate in the Magic Leap API failed. Reason: MLResult_NotImplemented 
UnityEngine.XR.MagicLeap.MLMedia/Player:.ctor (UnityEngine.XR.MagicLeap.MLResult&)
MagicLeap.Core.MLMediaPlayerBehavior:get_MediaPlayer () (at ./Library/PackageCache/com.magicleap.unitysdk@1.8.0/Runtime/APIs/MediaPlayer/Scripts/MLMediaPlayerBehavior.cs:83)
MagicLeap.Core.MLMediaPlayerBehavior:Reset () (at ./Library/PackageCache/com.magicleap.unitysdk@1.8.0/Runtime/APIs/MediaPlayer/Scripts/MLMediaPlayerBehavior.cs:373)
CameraCaptureExample:OnApplicationPause (bool) (at Assets/LSU/CameraCaptureExample.cs:98)
**Message 2**:
Exception: Media Player initialization result with error MLResult_NotImplemented.
MagicLeap.Core.MLMediaPlayerBehavior.get_MediaPlayer () (at ./Library/PackageCache/com.magicleap.unitysdk@1.8.0/Runtime/APIs/MediaPlayer/Scripts/MLMediaPlayerBehavior.cs:107)
MagicLeap.Core.MLMediaPlayerBehavior.Reset () (at ./Library/PackageCache/com.magicleap.unitysdk@1.8.0/Runtime/APIs/MediaPlayer/Scripts/MLMediaPlayerBehavior.cs:373)
CameraCaptureExample.OnApplicationPause (System.Boolean isPaused) (at Assets/LSU/CameraCaptureExample.cs:98)
**Message 2**:
DllNotFoundException: media_recorder.magicleap assembly:<unknown assembly> type:<unknown type> member:(null)
UnityEngine.XR.MagicLeap.MLMediaRecorder.Create () (at ./Library/PackageCache/com.magicleap.unitysdk@1.8.0/Runtime/APIs/MediaRecorder/MLMediaRecorder.cs:422)
CameraRecorder.StartRecording (System.String filePath, CameraRecorderConfig config) (at Assets/LSU/CameraCaptureExample.cs:584)
CameraCaptureExample.StartRecording () (at Assets/LSU/CameraCaptureExample.cs:347)
CameraCaptureExample.StartVideoCapture () (at Assets/LSU/CameraCaptureExample.cs:262)
CameraCaptureExample.OnCaptureButtonClicked () (at Assets/LSU/CameraCaptureExample.cs:227)
CameraCaptureExampleEditor.OnInspectorGUI () (at Assets/LSU/scripts/CameraCaptureExampleEditor.cs:18)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <da771086bc2e4cfc9ad0a72e083a7f98>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

**My Script**:
The script is part of the Magic leap 2 examples. I modified the code because i couldn't find a simpler version of the example that was more usable at first.

I think i'm missing dll files, i searched the interntent and i found this issue "https://forum.magicleap.cloud/t/seeking-assistance-with-video-preview-and-recording-in-magic-leap/2003/24" 

I used her script, and it was the same problem.
I checked that the camera was connected. Then I clicked capture. same log errors .

@tahatlal is this issue occurring on device or in the editor? Can you try using the camera capture example in the 1.9.0 Unity Examples project?

Sorry for the late response, but i was actively fixing the problem. I tried what you have suggested, but i always get "Not_Implemented" errors.
My objective is to record mixed-reality video from magic leap 2.
I tried another approach using WebRTC, i used the UnitySDK Examples app provided on magic leap 2. The connection between the server and ml2 works fine. However, I used the webRTC scenes from 1.9.0 v and 1.8.0 v, to see if it works.
I want to use the WebRTC script or have code that does the following:

  • Capture the mixed reality video and stream it to the server or browser. No need to display anything in unity.

The error logs when executing a WebRTC scene:

Error: MLWebRTCInstanceCreateWithDebugUtils in the Magic Leap API failed. Reason: MLResult_NotImplemented 
UnityEngine.XR.MagicLeap.MLWebRTC/VideoSink:Create (UnityEngine.XR.MagicLeap.MLResult&)
MagicLeap.Core.MLWebRTCVideoSinkBehavior:Awake () (at ./Library/PackageCache/com.magicleap.unitysdk@1.9.0/Runtime/APIs/WebRTC/Scripts/MLWebRTCVideoSinkBehavior.cs:55)

Error: MLWebRTC Start in the Magic Leap API failed. Reason: MLResult_NotImplemented
UnityEngine.XR.MagicLeap.MLWebRTC/VideoSink:Create (UnityEngine.XR.MagicLeap.MLResult&)
MagicLeap.Core.MLWebRTCVideoSinkBehavior:Awake () (at ./Library/PackageCache/com.magicleap.unitysdk@1.9.0/Runtime/APIs/WebRTC/Scripts/MLWebRTCVideoSinkBehavior.cs:55)

Error: MLWebRTCVideoSinkCreate in the Magic Leap API failed. Reason: MLResult_NotImplemented 
UnityEngine.XR.MagicLeap.MLWebRTC/VideoSink:Create (UnityEngine.XR.MagicLeap.MLResult&)
MagicLeap.Core.MLWebRTCVideoSinkBehavior:Awake () (at ./Library/PackageCache/com.magicleap.unitysdk@1.9.0/Runtime/APIs/WebRTC/Scripts/MLWebRTCVideoSinkBehavior.cs:55)

NullReferenceException: Object reference not set to an instance of an object
MagicLeap.Core.MLWebRTCVideoSinkBehavior.Awake () (at ./Library/PackageCache/com.magicleap.unitysdk@1.9.0/Runtime/APIs/WebRTC/Scripts/MLWebRTCVideoSinkBehavior.cs:60)

Error: MLWebRTCVideoSinkCreate in the Magic Leap API failed. Reason: MLResult_NotImplemented 
UnityEngine.XR.MagicLeap.MLWebRTC/VideoSink:Create (UnityEngine.XR.MagicLeap.MLResult&)
MagicLeap.Core.MLWebRTCVideoSinkBehavior:Awake () (at ./Library/PackageCache/com.magicleap.unitysdk@1.9.0/Runtime/APIs/WebRTC/Scripts/MLWebRTCVideoSinkBehavior.cs:55)
NullReferenceException: Object reference not set to an instance of an object
MagicLeap.Core.MLWebRTCVideoSinkBehavior.Awake () (at ./Library/PackageCache/com.magicleap.unitysdk@1.9.0/Runtime/APIs/WebRTC/Scripts/MLWebRTCVideoSinkBehavior.cs:60)
Error: MLWebRTCAudioSinkCreateEx in the Magic Leap API failed. Reason: MLResult_NotImplemented 
UnityEngine.XR.MagicLeap.MLWebRTC/AudioSink:Create (UnityEngine.XR.MagicLeap.MLResult&,UnityEngine.XR.MagicLeap.MLWebRTC/AudioSink/BufferNotifyMode)
MagicLeap.Core.MLWebRTCAudioSinkBehavior:Start () (at ./Library/PackageCache/com.magicleap.unitysdk@1.9.0/Runtime/APIs/WebRTC/Scripts/MLWebRTCAudioSinkBehavior.cs:82)

after i tried to connect in the scene:

Error: CreateRemoteConnection in the Magic Leap API failed. Reason: MLResult_NotImplemented 
UnityEngine.XR.MagicLeap.MLWebRTC/PeerConnection:CreateRemote (UnityEngine.XR.MagicLeap.MLWebRTC/IceServer[],UnityEngine.XR.MagicLeap.MLResult&)
MagicLeap.Examples.MLWebRTCExample/<<Login>b__62_0>d:MoveNext () (at Assets/MagicLeap/Examples/Scripts/WebRTC/MLWebRTCExample.cs:208)
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<MagicLeap.Examples.MLWebRTCExample/<<Login>b__62_0>d> (MagicLeap.Examples.MLWebRTCExample/<<Login>b__62_0>d&)
MagicLeap.Examples.MLWebRTCExample:<Login>b__62_0 (UnityEngine.AsyncOperation)
MagicLeap.ConcurrentWebRequestManager:<UpdateWebRequests>b__7_0 (UnityEngine.AsyncOperation) (at Assets/MagicLeap/Scripts/Utility/ConcurrentWebRequestManager.cs:74)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()
MLWebRTCExample.Login failed to create a connection. Reason: MLResult_NotImplemented.
UnityEngine.Debug:LogFormat (string,object[])
MagicLeap.Examples.MLWebRTCExample/<<Login>b__62_0>d:MoveNext () (at Assets/MagicLeap/Examples/Scripts/WebRTC/MLWebRTCExample.cs:211)
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<MagicLeap.Examples.MLWebRTCExample/<<Login>b__62_0>d> (MagicLeap.Examples.MLWebRTCExample/<<Login>b__62_0>d&)
MagicLeap.Examples.MLWebRTCExample:<Login>b__62_0 (UnityEngine.AsyncOperation)
MagicLeap.ConcurrentWebRequestManager:<UpdateWebRequests>b__7_0 (UnityEngine.AsyncOperation) (at Assets/MagicLeap/Scripts/Utility/ConcurrentWebRequestManager.cs:74)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()

Should i update the OS of the magic leap 2?

I updated the magic leap 2 OS from the magic leap hub. The OS version is 1.3.1 (secure). I tried the WebRTC scene but its giving me errors, "Not implemented" errors. Same as the previous replies.

Are you installing the application on your device or are you using App Simulator? The WebRTC example is only supported on device and requires you to build and deploy the application to the device. To receive the video stream on your computer you must use the scripts inside the /Assets/MagicLeap/Examples/WebRTCSetup/Server folder as stated in this guide : https://developer-docs.magicleap.cloud/docs/guides/unity/sdk-example-scenes/sdk-webrtc-scene

Thank you for your reply, but guys, please make it clear that if you ever run into problems like this "implementation error," the developer should have clear instructions on how to build it. Because it's very convenient to keep using the ZI connection, which is running on Magic Leap 2, without the need to build code and install it...

1 Like

@tahatlal Thank you for the feedback