Unity iPhone Problems and Solutions
SOP: Make sure you are running a debug version of the app. Do a debug run on Xcode and display the debugger console. Type “bt” to get a backtrace on the main thread, and “thread apply all bt” to see the backtrace of all the running threads of your app. If nothing useful comes out, type “c” to continue the execution then try displaying the backtrace again, until something (perhaps a backtrace to one of your Unity scripts) arises.
Problem: Xcode build failed: _mono_aot_module..._info referenced from: _mono_aot_module_..._info $non_lazy_ptr in RegisterMonoModules.o (maybe you meant: _mono_aot_module_..._info $non_lazy_ptr) Symbols(s) not found
Possible Causes: Unknown cause, possibly a bug in the Unity iPhone build pipeline itself.
Possible Solutions: Delete the Xcode project and recreate it from Unity.
Problem: Program crashes due to running out of memory.
Possible Causes: Running out of memory.
Possible Solutions (this is assuming you are using a device older than the iPhone 4):
- Make sure scene only has an average of 7,000 tris, give or take a few thousand.
- Make sure music is compressed, preferably 1 MB at most per file.
- Keep texture dimensions low. 128x128 is sufficient for single characters or buildings. Use 32x32 or 16x16 for small objects. Greater resolutions are ok for texture atlases.
- Use texture atlases.
- Make sure textures are compressed to PVRTC format (in Import Settings), 2 bits if possible, or 4 bits if 2 looks too ugly. PVRTC compression will not take place if your texture’s dimensions are not in power of two. GUI images don’t need to be PVRTC compressed but mesh textures should be.
- Remove mip-map generation (in Import Settings) if the texture is used for the GUI.
- Keep particle count low. Try increasing the particle’s size to make up for the lowered particle count.
- Review the scripts you have downloaded from the Internet. Most likely they were made for a desktop computer in mind, making use of lots of memory an iPhone device doesn’t have.
Problem: Program crashes and debugger reports: “Failed to load AOT module ... in aot-only mode.”
Possible Causes: Unknown cause. Possibly another bug in the Unity iPhone build pipeline.
Possible Solution: Delete the app in the device (using Xcode Organizer) then install it again.
Problem: Receiving “SIGBUS” signal
Possible Causes: Most likely a null reference exception in the Unity scripts.
Possible Solution: Check your code in the editor for null reference exceptions. Use the backtrace to pinpoint where in your code the error happens.
Problem: Receiving “SIGSEGV” signal
Possible Cause 1: Most likely caused by out of memory errors.
Possible Solution: See notes on out of memory problem.
Possible Cause 2: Unity iPhone 1.7 has a problem with C# GetComponent and GetComponentsInChildren when used with generics.
Possible Solution: Use the non-generic format instead.
Problem: When creating a new build: Error building Player: FileNotFoundException: Could not find file ".../Temp/StagingArea/iPhone-Trampoline/Unity-iPhone.xcodeproj/User.pbxuser". UnityEditor.HostView:OnGUI()
Possible Cause: Unknown
Possible Solution: Close Unity and delete the Temp folder in your project, then try making a build again.