November
24
2015

Having problems building your project or running your built project?

See if your issue is listed here or in the Unity troubleshooting pages for your build target. If you can’t find a solution, please contact me or post it in the community forum.

IL2CPP Code Stripping

Using the IL2CPP scripting backend will result in Unity’s compiler stripping/removing code it considers unused. While this isn’t a problem in most cases, it can result in errors due to missing code or DLL files in your built game – especially when reflection is used to access code, which is the case for most Makinom plugins.

You can prevent this by adding link.xml files to your project – they can be placed anywhere in your Assets folder (including any subfolder) and you can add multiple to your project. The link.xml file is a simple text file that can define which code should or shouldn’t be stripped.

For example, to prevent anything in Makinom’s DLL files from being stripped, use a link.xml file with the following content:

Another example, to prevent the ORK-Makinom Connection Plugin from being stripped:

You can find more information on this topic and the link.xml syntax in the Unity manual and download an example link.xml file here.

iOS

If you’re building your project for iOS, you may run into one of the following problems.

  • You are using Unity iPhone Basic. You are not allowed to remove the Unity splash screen from your game.
    To fix this, change in XCode’s build settings the ‘Compress PNG files’ setting to NO and build the project again.
  • Ran out of trampolines of type 2
    This is caused by use of generics, you have to tell the AOT compiler allocate more trampolines. To fix this, change in Unity’s Player Settings > Other Settings the ‘AOT Compiler Options’ to nimt-trampolines=512. If you’re still receiving a trampoline error, increase the number, e.g. 1024.
  • EXC_BAD_ACCESS
    This can be caused by Unity engine code being stripped when using ‘IL2CPP’ scripting backend. To fix this, disable ‘Strip Engine Code’ in Unity’s PlayerSettings > Other Settings in your iOS player settings.
  • Using the new UI (Unity 4.6+) and content is displayed outside of masks (e.g. text extends outside of GUI box)
    Go to ‘Edit > Project Settings > Player’ and enable ‘Use 24-bit Depth Buffer’ in the iOS ‘Resolution and Presentation’ settings in Unity.

You can find information on other issues and more detailed instructions on the Unity troubleshooting page.