Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Building Player takes forever when building for Android using IL2CPP

Discussion in 'Editor & General Support' started by DevCas1, May 21, 2021.

  1. DevCas1

    DevCas1

    Joined:
    Sep 24, 2015
    Posts:
    21
    Title says it all. Builder takes forever, basically hangs on "Building native binary with IL2CPP...". Been going for about half an hour now, with the progress bar stuck at the exact same spot since it built for 5 minutes.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    If this is the first time building for that project, it will take longer. Unity will cache a ton of IL2CPP stuff inside the Library/ folder within the project, and it should be much faster subsequently.

    I will admit though, half an hour is pretty long. Usually that amount of time for builds is only reached when you have a lot of scene lighting, which can take a looooooooong time to bake.
     
    Joe-Censored likes this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    If your computer is pretty slow, or your project is on HDD instead of SSD, the process can take exponentially longer than you'd otherwise expect.
     
  4. DevCas1

    DevCas1

    Joined:
    Sep 24, 2015
    Posts:
    21
    It's a 2D project with just UI (mostly images and a few SVGs for icons) and barely any code.
    Building for only ARMx64, project, editor and build target folder are on the same NVMe SSD. It's currently taking over 45 minutes...

    Project was built using the standard 2D template, not the 2D mobile template (although that one is even more applicable in hindsight)
    upload_2021-6-4_10-15-39.png
    Also linking the editor log, just in case.

    Edit: The completed build within 29 seconds was done with MONO instead of IL2CPP, but wanted to try IL2CPP again after reinstalling the editor and moving the project and build target folder to my new SSD
     

    Attached Files:

  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    Can you have a look at the process tree in Process Explorer (you may need to download it) when the builds is hanging at this point? I would be curious to know what part of the build process is stuck.
     
  6. DevCas1

    DevCas1

    Joined:
    Sep 24, 2015
    Posts:
    21
    This the information you're asking for?
    Screenshot 2021-06-11 222119.png Screenshot 2021-06-11 222319.png
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    Yes, thanks for the information. We've seen this hang happen on a few customer machines, but we're unable to reproduce it here yet. I have a few more questions to help us maybe narrow down the cause:

    Do you have an anti-virus program running? If so, which one?

    Are you using Bit Defender to encrypt this disk drive?

    Thanks!
     
  8. DevCas1

    DevCas1

    Joined:
    Sep 24, 2015
    Posts:
    21
    I'm using Bitdefender Antivirus Plus, but I do not encrypt any of my drives in any way.
    Bitdefender is also not showing any kind of message when building.
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    Can you temporarily disable Bit Defender and tty to build again?
     
  10. DevCas1

    DevCas1

    Joined:
    Sep 24, 2015
    Posts:
    21
    Build completed successfully in 295 seconds. Guess I'll have to disable Bitdefender until I can manage to add a dynamic exception for all builds. Thank you!
     
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    Thank you for trying that - that is excellent information!