I developed an iOS game in Unity editor which is also playable
in Unity editor and I did Build&Run the game in iOS (Xcode). The build is succeed but the game does not work properly. That is why I decided to debug my function and then I got the following errors in Xcode (NOT IN UNITY
):
NullReferenceException: A null value was found where an object instance was required. at BallScript.MobileControl () [0x00000] in :0
(Filename: currently not available on il2cpp Line: -1)
What is the reason to cause those errors and what can I do against them?
This means the code in the MobileControl
method in the BallScript
class is trying to use a null
value somewhere. I'd recommend debugging the code to better understand what is happening. You need to be using Unity 2018.2 or later to debug C# code on iOS. You can see directions about how to do that here: https://docs.unity3d.com/Manual/ManagedCodeDebugging.html
Note that the (Filename: currently not available on il2cpp Line: -1)
is benign. It is unrelated to the specific error in this case, and you can ignore it.