# Crash when launching app from 'Building a Simple App'

**URL:** <https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647>\
**Category:** Unity Development\
**Created:** [June 14, 2024, 5:02pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647 "2024-06-14T17:02:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjamin.poynter](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@benjamin.poynter](https://forum.magicleap.cloud/u/benjamin.poynter)\
**Post date:** [June 14, 2024, 5:02pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/1 "2024-06-14T17:02:39Z")

</div>

Detail: Using the tutorials provided by ML, I have worked my way up until 'Building to device' with Unity. I am able to Build And Run to my ML device which is USB tethered. When the app is launched, it force closes immediately. Through my ML device, I launch directly using the controller and it still force closes. I have followed the setup of the Unity project 1:1 to the guides. Is there another setup I am missing?

> **[Building a Simple App | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/unity/getting-started/unity-building-simple-app/)**
>
> This document describes how to build a Magic Leap 2 application using Unity.

**Unity Editor version** : 2022.3.9f1  
**ML2 OS version** : **ML2 OS Release B3E.240418.09-R.060**  
**Unity SDK version** : Latest (2.2.0)  
**Host OS** : (Windows/MacOS) : Windows

**Error messages from logs** (syntax-highlighting is supported via Markdown): Logs attached. Pulled from Device Bridge at time following multiple launch attempts and crashes.

[device\_Log\_20240614\_0953\_57.txt](https://forum.magicleap.cloud/uploads/short-url/u4vhVks2b9x5PNpGcBb2eMD0FnU.txt) (1.0 MB)

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [June 14, 2024, 6:27pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/2 "2024-06-14T18:27:40Z")

</div>

Do you mind running through the steps again and using the OpenXR workflow instead?

> **[Getting Started | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/unity-openxr/getting-started/openxr-unity-getting-started/)**
>
> These guides serve as a starting point for Magic Leap app development in Unity using OpenXR. If this is your first time developing for Magic Leap, we recommend that you follow the guides sequentially. If you are an experienced Magic Leap developer,...

Please make sure you have the latest version of the Magic Leap Unity SDK package installed and that the Magic Leap Support is selected in the XR Plugin Management under OpenXR

---

<div class="post-metadata">

**Author:** ![benjamin.poynter](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@benjamin.poynter](https://forum.magicleap.cloud/u/benjamin.poynter)\
**Post date:** [June 17, 2024, 4:38pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/3 "2024-06-17T16:38:13Z")

</div>

Hi. I re-ran the entire setup of Magic Leap for Unity WITH the OpenXR workflow (erased everything, started anew) and I still can package to device and get an automatic crash.

Latest device pulled from Device Bridge attached.

[device\_Log\_20240617\_0936\_07.txt](https://forum.magicleap.cloud/uploads/short-url/2yoEyDvfNWarcvYJDyMJkNEMt03.txt) (904.1 KB)

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [June 17, 2024, 5:00pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/4 "2024-06-17T17:00:58Z")

</div>

Thank you for providing the Logs.

Can you verify that the Spatial Anchor permission is enabled in the Magic Leap Permission settings, and check if the Magic Leap Spatial Anchor Subsystem and Spatial anchor storage features are enabled as well?

Were you able to run the preconfigured unity example project or did that project also crash ?

---

<div class="post-metadata">

**Author:** ![benjamin.poynter](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@benjamin.poynter](https://forum.magicleap.cloud/u/benjamin.poynter)\
**Post date:** [June 17, 2024, 5:19pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/5 "2024-06-17T17:19:16Z")

</div>

Hi.

I checked and all those permissions were set to true.

Which specifically may be the preconfigured Unity example project?

Is it this? [Example Project | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/unity-openxr/openxr-unity-samples/) I may have experienced a crash there too.

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [June 17, 2024, 5:22pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/6 "2024-06-17T17:22:49Z")

</div>

Do you mind verifying that the crash occurred when building from that project and sharing the logs if it did crash?

If it does crash, can you verify the OS version that is listed on Device Bridge inside the Magic Leap Hub ?

---

<div class="post-metadata">

**Author:** ![benjamin.poynter](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@benjamin.poynter](https://forum.magicleap.cloud/u/benjamin.poynter)\
**Post date:** [June 17, 2024, 5:35pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/7 "2024-06-17T17:35:59Z")

</div>

Here's a logcat log from my recent test specifically. Attached.

I will attempt to download the sample project and test.

[com.UnityTechnologies.com.unity.msg.magicleapbase-logcat.txt](https://forum.magicleap.cloud/uploads/short-url/rYhTxCPicUBnFJPbgRiAI6xHvhP.txt) (90.9 KB)

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [June 17, 2024, 5:50pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/8 "2024-06-17T17:50:19Z")

</div>

Thank you, let me know if you run into any issues with that project.

Testing the sample will help us understand which step is causing the application to crash when deployed to a device.

---

<div class="post-metadata">

**Author:** ![benjamin.poynter](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@benjamin.poynter](https://forum.magicleap.cloud/u/benjamin.poynter)\
**Post date:** [June 17, 2024, 5:56pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/9 "2024-06-17T17:56:27Z")

</div>

[com.magicleap.unity.examples-logcat.txt](https://forum.magicleap.cloud/uploads/short-url/7BZ3qGra3giVMUxzhfkYvMW6dtE.txt) (128.8 KB)

Thanks. Crash log(cat) from the samples project also attached.

Successful build. Same crash on startup.

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [June 18, 2024, 6:15pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/10 "2024-06-18T18:15:30Z")

</div>

Hi Benjamin, can you confirm that you were able to run the application after upgrading to the latest OS.

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [June 18, 2024, 6:33pm UTC](https://forum.magicleap.cloud/t/crash-when-launching-app-from-building-a-simple-app/3647/11 "2024-06-18T18:33:03Z")

</div>


