NRSDK 2.2.1 Build Error

I am attempting to build HelloMR from the Unity 2.2.1 SDK.

I have spent 12+ hours attempting to get it to run.
It doesnt work.

I have tried Unity 2019.4.40f1 - broken due to grade out of date problems
Unity 2022.3.37f1 is what I am currently using.

I have follow the getting started instructions on Getting Started with NRSDK | NRSDK to the letter, tripled checked, and tried again and again.

I have created new projects 4 times.
I am using an Samsung Galaxy S23 Ultra 5G that is fully up to date on Android 14.
I am using xReal Air 2 Ultra glasses.

I can’t even debug the dang app - it crashes on launch and the debugger doesn’t even pick anything up.

Build output shows clean build.

The only error I can actually seem to find is when attempting Build and Run with wireless ADB - I get the following error:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Android.AndroidDeploymentTargetsExtension.StartApplication (UnityEditor.Android.AndroidBuildProperties buildProperties, UnityEditor.Android.AndroidDevice device, UnityEditor.ProgressTaskManager taskManager) (at <29896ac0d75741c388d780aac712a819>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension+<>c__DisplayClass15_1.<LaunchBuildOnTarget>b__5 () (at <29896ac0d75741c388d780aac712a819>:0)
UnityEditor.ProgressTaskManager.Run () (at <4f70cf68b8b24a78aa3a87c1d6120925>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <29896ac0d75741c388d780aac712a819>:0)
UnityEditor.DeploymentTargets.DeploymentTargetManager.LaunchBuildOnTarget (UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <4f70cf68b8b24a78aa3a87c1d6120925>:0)
UnityEditor.PostprocessBuildPlayer+<>c__DisplayClass22_1.<LaunchOnTargets>b__1 () (at <4f70cf68b8b24a78aa3a87c1d6120925>:0)
UnityEditor.ProgressTaskManager.Run () (at <4f70cf68b8b24a78aa3a87c1d6120925>:0)
UnityEditor.PostprocessBuildPlayer.LaunchOnTargets (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, UnityEditor.Build.Reporting.BuildReport buildReport, System.Collections.Generic.List`1[T] launchTargets) (at <4f70cf68b8b24a78aa3a87c1d6120925>:0)
UnityEditor.Android.PostProcessAndroidPlayer.Launch (UnityEditor.BuildTarget target, System.String installPath, UnityEditor.Build.Reporting.BuildReport report) (at <29896ac0d75741c388d780aac712a819>:0)
UnityEditor.Android.AndroidBuildPostprocessor.LaunchPlayer (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at <29896ac0d75741c388d780aac712a819>:0)
UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at <4f70cf68b8b24a78aa3a87c1d6120925>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

There is no StartApplication or Launch command in the manifest file.

Help. Please. I’ve lost a full day of time and cant even get your first tutorial to work.

And the documentation itself is really difficult to use, it is inconsistent from page to page about unity versions, screenshots, and devices. Most of the pages still reference the nReal Light device even though it’s no longer supported?

I had the same struggles with HelloMR crashing , so here’s a few things I did to be able to build and run HelloMR with the Ultra on my Fold 5 (same Snapdragon 8 Gen 2 processor as S23)

Unfortunately, I can’t pinpoint you what exactly made it all run, I tried various combos of things at the same time…:

  • Used Unity 2022.3.21f1 which is the version xReal used to construct the demos apparently
  • Toggled “on” every item in the NRLibraryStripConfig file found in the Assets folder
  • For Minimum API Level use Android 10.0 API level 29 in Project Settings->Player->Other Settings
  • I only ran the app from within Nebula AR Space. I can’t seem to get any of these apps to run standalone within Android UI itself

If this still fails, you could always clone the repo supplied by xReal from one of the other threads recently about build problems. I was able to build and run the HelloMR app using the repo, so you could try to create a starting template from there.

I already tried to file compare the asset config files between the repo folders and my Unity project (when I tried to replicate the SDK documentation line by line). I couldn’t find anything different between asset config files between the two, aside from the recommended mininum API level (documentation says use 8.0, but the repo used 10.0)

Best of luck, and hopefully you pinpoint the issue that I couldn’t find.

@Nyb72 - thanks for the pointers.

Went to sleep and came back and read through more threads.

It turns out that it is a single setting - Build Settings->Player->Other Settings->Target API Level

If you follow the guide and choose “Highest Installed” it will crash on launch on any Android 14 device.

This is so messed up as the ONLY devices certified by xReal for Air 2 Ultra development are… drumroll… Android 14 devices. The NRSDK is broken out of the box and documentation is wrong. And I found this out from threads here and in Discord from weeks and months ago. They haven’t update their docs in 3 months.

This is the worst initial developer experience I’ve ever had with a hardware product, and this kind of small thing can be fixed in less than 5 minutes with a docs update. There’s no excuse. It’s a shame because the hardware is so well done, but this SDK and software path is like a slap in the face to developers.

1 Like

Sorry for the bad experience and any inconvenience, we’ve updated the documentation.

However, I have a question about your statement:

This is so messed up as the ONLY devices certified by xReal for Air 2 Ultra development are… drumroll… Android 14 devices.

We’ve tested on Android 10, 11, 12, 13, and 14. Could you please provide more details on how you reached this conclusion?