Several issues can occur with IL2CPP builds, resulting in inputs not being recognized or even exceptions being thrown like those below.


In the Player.log or device log:

2023-05-25 15:16:12.315 5024-5051/com.GameDriver.MobileTennis W/Unity: Unable to resolve function UnityEngine.Input::GetKey
2023-05-25 15:16:12.315 5024-5051/com.GameDriver.MobileTennis W/Unity: Unable to resolve function UnityEngine.Input::GetKeyDown
2023-05-25 15:16:12.315 5024-5051/com.GameDriver.MobileTennis W/Unity: Unable to resolve function UnityEngine.Input::GetKeyUp


This is commonly found with Legacy XR input handling (pre-Input System package):

Unable to resolve function UnityEngine.Input::GetButtonDown
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
gdio.unity_agent.ByteUtilities:GetFunctionPointer(MethodInfo)
gdio.unity_agent.GDIOAgent:Initialize()
gdio.unity_agent.GDIOAgent:Awake()


Or something indicating "Cannot mashal type..." such as the following:

MarshalDirectiveException: Cannot marshal type 'System.Collections.Generic.List`1<UnityEngine.XR.XRNodeState>'.
  at OVRNodeStateProperties.ValidateProperty (UnityEngine.XR.XRNode nodeType, UnityEngine.XR.XRNodeState& requestedNodeState) [0x00000] in <00000000000000000000000000000000>:0 
  at OVRNodeStateProperties.GetNodeStatePropertyVector3 (UnityEngine.XR.XRNode nodeType, NodeStatePropertyType propertyType, OVRPlugin+Node ovrpNodeType, OVRPlugin+Step stepType, UnityEngine.Vector3& retVec) [0x00000] in <00000000000000000000000000000000>:0 
  at OVRInput.GetLocalControllerPosition (OVRInput+Controller controllerType) [0x00000] in <00000000000000000000000000000000>:0 
  at OVRCameraRig.UpdateAnchors (System.Boolean updateEyeAnchors, System.Boolean updateHandAnchors) [0x00000] in <00000000000000000000000000000000>:0 

To resolve many issues such as these, it is necessary to run the IL2CPP Post Processor found in the GameDriver > Experimental menu in the Unity editor, and build the project again. Be sure not to run a "Clean build" after selecting this option.


You should see something similar in the editor log if the Post Processor was successful:


Once you run the IL2CPP Post Processor and build the project again, these errors should be resolved. If you still experience any of these issues, please let us know at support@gamedriver.io