Built App with MLCamera before deprecation -- Now not working!

Hi all! I built a game for the Magic Leap 2 and I was recording gameplay with the Magic Leap's camera using the MLCamera API. I built the app before the deprecation of the MLCamera API. The specs I'm using are as follows:

Unity Editor version: 2022.3.10f1
ML2 OS version: 1.5.0
Android API Level: 29
Host OS: Windows

I hadn't done any updates on Unity or on the Magic Leap software. In the game, I record game play using the Magic Leap's camera and then upload the data to my computer so I can rewatch the gameplay. I recorded several gameplays back to back and somewhere in between, the recordings stopped working entirely. The videos returned blank and the text I had printed to a .txt file (showed final scores) didn't exist at all.

I opened Unity and suddenly had a bunch of warnings.

Warning messages from logs: warning CS0618: 'MLCamera' is obsolete: 'This API is deprecated in favor of the standard android SDK and NDK'

This is obviously frustrating as I updated nothing and built my app before deprecation. My question is: is there any way to undo this? Is there some way I can make it continue to use MLCamera (which was working perfectly before it decided to stop without warning)? Or do I have to swithc everything over to the Android API?

Thanks in advance!

Hi @Yikes,

Welcome to the Magic Leap 2 Developer Forums. We are so grateful to have you here engaging with us.

The MLCamera API should still be functional. What version of the Unity SDK does the package manager say that you are running? When running the game on your device, are there any errors that come up in the Android Logs?

Do you think that you could share the code snippet that captures the gameplay?



Hi @etucker!

Thanks for your quick response.
Unity SDK: 2.1.0

No errors pop up on the Android logs. It was running perfectly for weeks and then suddenly stopped with no interference. The only issue I could see was the sudden warnings that popped up on the Unity console. I am supposed to have a debug log that pops up if recording failed, but it's not appearing. My guess is that it's because a "video file" of some type is being generated, it just doesn't have any actual video with it.

I don't know how helpful it would be to see my code because I've got a few different snippets that handle different aspects of recording (the recordings save different corresponding text files depending on which button I press to start recording). Is there something specific it would be helpful to see?

On your Project Settings > XR Plug-in Management > Plug-in Providers screen, do you have Magic Leap selected only?

If this is the case for you and you are still encountering this issue, I would consider downgrading to the ML Unity SDK version 1.12.1 and this may fix this.

Let us know if you have any questions.