Unable to get Hello MR Working on Air2Ultra

I’m having trouble getting HelloMR to work with my Xreal Air 2 Ultra Glasses. I can build and deploy the app but when I try to launch it I see the Made with Unity Splash screen on my phone and after a few seconds it returns to the home screen. Nothing appears in the glasses.

I can run Nebula. I can also run the the Spatial Life Demo using the apk download. https://nreal-public.nreal.ai/download/Application/spatiallife0619.apk
I’m using a Samsung Galaxy S23 Model SM-S911U1
One UI Version 6.1
Android version 14
Version: S911U1UES4CXE9 / S911U1OYM4CXE9 / S911U1UES4CXE9
Security Path Level: July 1, 2024

I’m following the steps outlined at Getting Started with NRSDK | NRSDK
I downloaded and installed
Unity 2022.3.39f1
NRSDKForUnityAndroid_2.2.1.unitypackage
Android SDK 14.0 (“UpsideDownCake”)
Android SDK Platform 34
Sources for Android 34
Opened Unity and created a new 3D Project
Imported NRSDKForUnityAndroid_2.2.1
Used the NRSDK project tips and accepted all
Set up the project for Android
For player settings I set
Player Settings > Resolution and Presentation > Default Orientation: Portrait
Player Settings > Other Settings > Auto Graphics API: False
Player Settings > Other Settings > Graphics APIs: OpenGL ES
Player Settings > Other Settings > Package Name: com.xreal.r4firstMr
Player Settings > Other Settings > Minimum API Level: API Level 34
Player Settings > Other Settings > Write Permission: External (SDCard)
Project Settings > Quality > VSync Count: Don’t Sync
In NRProjectConfig: Checked Reality and Vision, and supportMutliResume checked in NR Project Config. It was unclear which was correct for the Xreal Air 2 Ultra
NRKernalSessionConfig: Unchecked Force Kill While Glasses Switch Mode
NR Library Strip Config: Left everything unchecked
In Build Settings. Selected the scene NRSDK/Demos/HelloMR
In project settings I disabled MultiThreadedRendering and confirmed the scripting backend was set to IL2CPP
Then I chose build and run.
The app appears on my device and in the nebula app, but trying to launch it while wearing the glasses either through the nebula app or directly from the homescreen just flashes the Unity logo and then closes.
I’m including a link to a onedrive folder with screenshots of the settings and the logcat log
If any other info would be helpful please let me know
HelloMRSteps

Hi developer,

thank you for providing detailed information. Your settings seem to be correctly configured. However, the log file you provided does not contain enough details related to NRSDK. Next time, for a more comprehensive analysis, could you please capture the log from before you plug in the glasses until the app exits? This will help us get a complete picture of the issue.

In the meantime, I recommend you review a similar issue discussed in this post. It might provide additional insights and potential solutions.

Additionally, you might want to try building directly from this repo and using it as a template. This could serve as a good starting point and help identify any discrepancies in your current setup.

In my project settings - Player - Other Settings
I currently have:
minimum API Level set to Android 10 Level 29
Target API Level set to Automatic (highest installed)

I have Android SDK 33 and 34 installed via Android Studio

To be honest, I don’t know if my API settings are the most ideal or optimized, of if I need to change them because of my deployed device. I just kept iterating API changes until my app builds finally worked. I think there was another user that said 14.0 level 34 doesn’t work and in your settings, you just happen to have it set as a minimum.

I’m pretty sure you can only run your built Apps through Nebula, they do not start standalone

Otherwise, I believe the rest of your settings match mine.

If that still doesn’t work…
In some other threads here, we’ve posted some APK files via google drive to try. These were built by various users via the SDK, so try those out to ensure that it’s not because of your phone for some reason
There’s another thread where xReal posted a github repo of a Unity project. Building off of that worked for me.

Thanks for your quick reply
I create a new log from before I plugged in the glasses
It’s available at Microsoft OneDrive
For that log I plugged in the glasses. It prompted me to start Air Casting. I selected my app.
It showed the unity splash screen then closed.
After that I select nebula and airspace.
I found my app in airspace and tried to launch it from there
Again It showed the unity splash screen then closed.
Let me know if I can provide any more data to help diagnose the problem

I tried using the project from the repo. After linking it to my account it behaves the same way my project does.

I tried repeating the whole process on a different computer and had the same results.

I’ve shared APK files I’m generating
APKs
The desktop and laptop APKs were generated on two different computers
The XRealSampleGitRepo APK was generated using git repo link

Does the app need to request more permissions or can that file be made not writable?

Error libc++abi terminating with uncaught exception of type jni::InvocationException: java.lang.SecurityException: Writable dex file '/storage/emulated/0/Android/data/com.xreal.HelloMrDesktop/cache/nr_api.dat' is not allowed.

Hi developer,

sorry for the late reply. I’ve been a little busy recently. I’ve tried testing the APKs you uploaded to OneDrive.
image
Both of them worked well on my Samsung Note20, with Ultra and Nebula 3.8.0.

I was wondering if there are any permissions you might have missed granting.

For the SampleGitRepo app, it will request permission to show on top the first time you launch it. For the helloMRDesktop app, in addition to that, there is also a permission request to access media files, or something similar, after you grant the previous one.

Regarding the sequence to start the app, here’s a reference:

1.	Insert Light into the phone.
2.	Open Nebula.
3.	Enter AR Space.
4.	Pull up your phone’s home button (it’s okay if you see the small icon of Nebula).
5.	Click HelloMR on the home screen.

There’s another developer met the same issue as you, probably you can take a look: Unity project cannot be loaded into glasses - #16 by Dorix

Which version of Android are you running? I see the Note 20 originally had Android 10 it looks like it can only be upgraded to Android 13.

I’m using a Galaxy S23 which comes with Android 14.
There was a change introduced in android 14 where executable code has to be marked read only.

I can run the “Spatial life” demo APK. So something must be different about how that was produced.
https://nreal-public.nreal.ai/download/Application/spatiallife0619.apk

I’ve granted the app every permission it requested. I tried adding more permissions to the android manifest, but it’s not prompting me for them.

It was Android 11.
I’ll double check with the engineer who developed spatial life and get back to you.

Edited:
It was 29-33.

Hello, bringing back this thread. I’m getting the same error:

Error libc++abi terminating with uncaught exception of type jni::InvocationException: java.lang.SecurityException: Writable dex file '/storage/emulated/0/Android/data/com.xreal.myapp/cache/nr_api.dat' is not allowed.

but all of my devices are on android 14. I noticed the Spatial Life demo demo does work on android 14 and was wondering if there was a beta version of nrsdk that supports android 14 that I could get access to. Any help would be appreciated

Actually, both NRSDK 2.2.x and 2.3.0 support Android 14. There’s also an example showcasing the integration of NRSDK with MRTK3, and the released apps run smoothly on Android 14 devices. You can check it out here:

Could you provide the complete log for us to investigate further?

A potential reason could be related to the write permission.
img_v3_02el_d3135db3-0d4f-459a-89c1-312b3db5353g
Please take a look at your project settings and ensure the storage option is set to External.

Have you actually tried running the apps on Android 14? Last I heard from you, you were testing on Android 11. It’s been over a month and I’m still waiting for a reply.

I’ve had the Air 2 Pro Ultras for over 2 months and I still can’t get helloMR to run on a phone which one of the two officially supported devices. I don’t know what other information I can provide to get this resolved.