# Input Related Exception on Latest Magic Leap SDK (Windows Unity target)

**URL:** <https://forum.magicleap.cloud/t/input-related-exception-on-latest-magic-leap-sdk-windows-unity-target/3670>\
**Category:** Unity Development\
**Created:** [June 20, 2024, 7:38pm UTC](https://forum.magicleap.cloud/t/input-related-exception-on-latest-magic-leap-sdk-windows-unity-target/3670 "2024-06-20T19:38:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![om-iman](https://avatars.discourse-cdn.com/v4/letter/o/3ab097/32.png) [@om-iman](https://forum.magicleap.cloud/u/om-iman)\
**Post date:** [June 20, 2024, 7:38pm UTC](https://forum.magicleap.cloud/t/input-related-exception-on-latest-magic-leap-sdk-windows-unity-target/3670/1 "2024-06-20T19:38:05Z")

</div>

After updating our Magic Leap SDK to the latest version as of this writing (2.2.0) from 1.12.0, I'm seeing an exception on startup on Windows builds of my project (it is a client-server based application with the Windows build being the server and the ML2 acting as a client). It appears that something that should only be initializing on a Magic Leap device is getting initialized on the Windows platform in the SDK.

It does not seem to break the functionality of the app, but I still want to eliminate it.

> Initializing input.  
> New input system (experimental) initialized  
> Using Windows.Gaming.Input  
> Input initialized.  
> Initialized touch support.  
> UnloadTime: 1.117000 ms  
> Exception: Field currentActivity or type signature not found  
> at UnityEngine.\_AndroidJNIHelper.GetFieldID (System.IntPtr jclass, System.String fieldName, System.String signature, System.Boolean isStatic) [0x00082] in :0  
> at UnityEngine.AndroidJNIHelper.GetFieldID (System.IntPtr javaClass, System.String fieldName, System.String signature, System.Boolean isStatic) [0x00001] in :0  
> at UnityEngine.\_AndroidJNIHelper.GetFieldID[ReturnType] (System.IntPtr jclass, System.String fieldName, System.Boolean isStatic) [0x00012] in :0  
> at UnityEngine.AndroidJNIHelper.GetFieldID[FieldType] (System.IntPtr jclass, System.String fieldName, System.Boolean isStatic) [0x00001] in :0  
> at UnityEngine.AndroidJavaObject.\_GetStatic[FieldType] (System.String fieldName) [0x0000c] in :0  
> at UnityEngine.AndroidJavaObject.GetStatic[FieldType] (System.String fieldName) [0x00001] in :0  
> at UnityEngine.XR.MagicLeap.MLDevice.Awake () [0x00025] in :0  
> UnityEngine.GameObject:Internal\_AddComponentWithType(GameObject, Type)  
> UnityEngine.GameObject:AddComponent(Type)  
> UnityEngine.GameObject:AddComponent()  
> UnityEngine.XR.MagicLeap.MLDevice:InstantiateSingleton()

---

<div class="post-metadata">

**Author:** ![etucker](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/etucker/32/842_2.png) [@etucker](https://forum.magicleap.cloud/u/etucker)\
**Post date:** [June 21, 2024, 7:27pm UTC](https://forum.magicleap.cloud/t/input-related-exception-on-latest-magic-leap-sdk-windows-unity-target/3670/2 "2024-06-21T19:27:54Z")

</div>

Hi @om-iman,

I would recommend using [Unity's Conditional Compilation](https://docs.unity3d.com/Manual/PlatformDependentCompilation.html) here around Magic Leap-Specific code.

Here is an example:

```auto
#if PLATFORM_STANDALONE
using UnityEngine.XR.MagicLeap;
#endif

```

Let me know if this works out for you.

Best,

El

---

<div class="post-metadata">

**Author:** ![etucker](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/etucker/32/842_2.png) [@etucker](https://forum.magicleap.cloud/u/etucker)\
**Post date:** [July 26, 2024, 8:16pm UTC](https://forum.magicleap.cloud/t/input-related-exception-on-latest-magic-leap-sdk-windows-unity-target/3670/3 "2024-07-26T20:16:46Z")

</div>


