1

I'm using Unity 5.2 and Xcode 7, and when I choose IL2CPP as scripting backend, Universal for architecture, and run on Xcode: I get this error several times at runtime:

(Filename: currently not available on il2cpp Line: -1)
NullReferenceException: A null value was found where an object instance was required.
at BaseMenuControl.baseUpdate () [0x00000] in <filename unknown>:0 
at MainMenu.Update () [0x00000] in <filename unknown>:0 

Where MainMenu inherits BaseMenuControl and BaseMenuControl inherits MonoBehaviour, except this, there is nothing special.

Is there anybody to help/guide me?

Dilara Albayrak
  • 314
  • 1
  • 3
  • 23

1 Answers1

2

There are a number of reasons why something could be null in the player instead of in the editor. I would first recommend trying this with the Mono scripting backend.

If it works in that case, then the IL2CPP scripting backend is likely stripping something you need. You can manually preserve things by following the directions here:

http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html

If the same problem happens with the Mono scripting backend, then it might be worth debugging your script code running on the device to see what is happening there. This is possible with MonoDevelop as described here:

http://docs.unity3d.com/Manual/MonoDevelop.html

Josh Peterson
  • 2,299
  • 19
  • 21
  • As far as i know Mono scripting backend does not support both arm64 and armv7, am i wrong? – Dilara Albayrak Oct 12 '15 at 06:30
  • Even though it supports without my knowledge, it gives several "undefined symbols for architecture arm64" errors which i cant handle(when i try to search about these errors, i am suggested to use IL2CPP scripting backend). I need both armv7 and arm64 support so that Apple accepts my project to AppStore. – Dilara Albayrak Oct 12 '15 at 07:16
  • The Mono scripting backend support only armv7 (32-bit) not arm64. You need to use the IL2CPP scripting backend, which supports both armv7 and arm64. – Josh Peterson Oct 12 '15 at 19:02
  • Yes, my point is i do not have any problem on Mono scripting backend but it is meaningless, and for IL2CPP i'm having problem explained above. It is still insoluble. – Dilara Albayrak Oct 13 '15 at 07:14
  • Ahh, ok. So first I would try to disable stripping for any assemblies you have, as shown in the first link I mentioned. If disabling stripping does not correct the issue, then this may be a bug in IL2CPP. In that case, please submit a bug report, and will attempt to correct it. – Josh Peterson Oct 13 '15 at 11:45