Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by froYo · Apr 02, 2015 at 05:32 PM · c#iosbuild-error

Cross compilation job Assembly-CSharp.dll failed. When building iOS.

Hi everyone, i'm having some problems building to iOS even though my project builds to android perfectly fine.

UNITY 5.0.0f4 free


Here is the error message i'm receiving when trying to build:

Cross compilation job Assembly-CSharp.dll failed. UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/Tools/OSX/mono-xcompiler-wrapper.sh --aot=full,asmonly,nodebug,static,outfile="Assembly-CSharp.dll.s" "Assembly-CSharp.dll" current dir : /Users/NAME/Desktop/New Unity Project/Temp/StagingArea/Data/Managed result file exists: False. Timed out: False

stdout: Mono Ahead of Time compiler - compiling assembly /Users/NAME/Desktop/New Unity Project/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll * Assertion at mini-arm.c:4771, condition `cfg->code_len < cfg->code_size' not met

stderr:

at UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile) [0x000df] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/MonoAssemblyStripping.cs:113 at UnityEditor.MonoCrossCompile.CrossCompileAOT (BuildTarget target, System.String crossCompilerAbsolutePath, System.String assembliesAbsoluteDirectory, CrossCompileOptions crossCompileOptions, System.String input, System.String output, System.String additionalOptions) [0x0033c] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/MonoCrossCompile.cs:318 at UnityEditor.MonoCrossCompile+JobCompileAOT.ThreadPoolCallback (System.Object threadContext) [0x00000] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/MonoCrossCompile.cs:52 UnityEditor.HostView:OnGUI()


I have absolutely no idea what any of this means so if someone could help a simpleton to understand it, that would be great.

After searching online I came to the conclusion that this means there is an issue with one of my scripts. So i created a new project only importing scripts which i have written, leaving out everything else and the problem is still there. (Confirming my conclusion)

I have no compiler errors or warnings (pre building) so i was wondering if anybody knew a way that i could find out exactly which script is causing the issue.

It's a large project and many of the scripts depend on each other, making simply deleting each one and rebuilding quite an undertaking. However if there is no other way i suppose it's the only option.

Thanks in advance for any help!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by froYo · Apr 10, 2015 at 11:39 AM

After a couple of days i have solved this problem for me via this method.

I guessed that it was caused by the project being upgraded from unity 4.6 to unity 5 and this process had messed up one of my scripts somehow.

  • Created an empty project and imported my scripts only. Tried to build and make sure this issue was not caused by a plugin or something. Make sure you copy your scripts into the new project, don't directly edit them because you will need to delete them and parts of them to figure out what is wrong. Keep a backup of your project in it's entirety!

  • Delete a script fixing any errors created by just commenting out references etc.

  • Build the project and see if the AOT error still exists.

  • Repeat above until the project builds.

  • Make a new project and import all scripts again.

  • Delete just the last script you did when the project built (fixing any errors the same way as before).

  • Try and build again, it should be successful so you know this issue is with this particular script. Or a reference to it which you have commented out (to fix errors) in another script.

  • Make a new project and import all scripts again.

  • Go into the problem script and into the first function and comment everything inside it out.

  • Try and build the project.

  • Repeat this for all functions in the script until the project builds.

  • If the project does not build you will have to check any scripts that needed to be commented out previously. (This was not my issue so I have no advice here, you can still probably adapt this method)

  • When the project builds after commenting out a function, un-comment each previous one and build.

  • If the project builds each time until you have just that 1 function left, you know that this one is the issue. (It's probably possible to have more than 1 problematic function, in this case you should leave them commented and use the next step on each problematic function).

  • Once you have 1 or more functions which fail the build, go through each one un-commenting a line in the function and building.

  • If the project builds, leave it un-commented. However if not leave it commented.

  • Do this until you are left with a few lines of code commented and a project that builds.

  • Now you have to figure out why these lines of code are causing your project to fail.

It's very possible that there is actually no issue with the code commented out. In my case i had 1 line of code which was the problem. It took a struct from an array and called a function in another script. I had done this 7 times above in exactly the same way, yet each of these lines would build successfully.

I can say with 100% certainty that there was nothing wrong with that line at all, the only way i managed to get the project to build was to change.

 SomeFunction(MyArray[MyArray.Length -1]);

to

 int arrayPos = Array.Length -1;
 SomeFunction(Array[arrayPos]);

This is pseudo code, not the actual code from my project, just to simplify the example.

As you can see, how there was an issue i do not know my guess is that when i converted the project from unity 4.6 to unity 5 it somehow bugged out and decided that this line of code didn't make sense.

All in all it was pretty much a complete waste of time for something that really didn't need fixing.

I hope this helps someone.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
4

Answer by kris111 · Jan 17, 2017 at 11:57 PM

I had the same problem. Managed to fix it by changing Scripting Backend option to IL2CCP (Mono2x caused problems).

Edit -> Project Settings -> Player -> Other Settings/Configuration

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JamesKaret · Mar 09, 2021 at 01:01 AM 0
Share

using 2017.4.40 this answer should be on top.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

iOS Restoring Purchases through Playfab 0 Answers

Why using UnityEditor.SceneManagement; is gray like not in use and give error when building my game ? 2 Answers

Problem in build but no problem in playmode - DDS/netmodule 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges