Troubleshooting Feb 20, 2026 12 min read

IL2CPP + Burst 2.0 Builds Stuck at 'Compiling Assembly' - How to Fix

Fix Unity builds stuck at 'Compiling Assembly' when using IL2CPP and Burst 2.0. Step-by-step troubleshooting guide for build process hangs, compilation errors, and performance optimization.

By GamineAI Team

Unity builds getting stuck at "Compiling Assembly" when using IL2CPP and Burst 2.0 is a common issue that can waste hours of development time. This comprehensive guide provides proven solutions to fix build process hangs and get your IL2CPP + Burst 2.0 builds completing successfully.

The Problem: IL2CPP + Burst 2.0 Builds Stuck at "Compiling Assembly"

Common Symptoms:

  • Build process hangs at "Compiling Assembly" step
  • Unity appears frozen with no progress indicator
  • Build takes hours or never completes
  • High CPU usage but no disk activity
  • Console shows compilation warnings but build doesn't progress
  • Build succeeds but takes extremely long time (30+ minutes)

Why This Happens: IL2CPP + Burst 2.0 build hangs are typically caused by:

  • Large codebase compilation exceeding memory limits
  • Burst compilation errors that cause silent failures
  • Insufficient system resources (RAM, disk space, CPU)
  • Corrupted Burst cache causing repeated compilation attempts
  • IL2CPP code generation issues with complex C# code
  • Burst job compilation conflicts with IL2CPP backend
  • Missing or outdated Burst compiler installation

Solution 1: Clear Burst Cache and Rebuild (Quick Fix)

Corrupted Burst cache is the most common cause of compilation hangs. Clearing it forces a fresh compilation.

Step-by-Step Fix:

  1. Close Unity Editor:

    • Save all your work
    • Completely quit Unity Editor
    • Ensure no Unity processes are running
  2. Clear Burst Cache:

    • Navigate to: Library/Bee/artifacts/
    • Delete the entire Bee folder
    • Navigate to: Library/BeeBackend/
    • Delete the entire BeeBackend folder
    • Navigate to: Library/PlayerDataCache/
    • Delete the entire PlayerDataCache folder
  3. Clear IL2CPP Cache:

    • Navigate to: Library/Il2cppBuildCache/
    • Delete the entire Il2cppBuildCache folder
    • Navigate to: Temp/
    • Delete all files in the Temp folder
  4. Restart Unity and Rebuild:

    • Open Unity Editor
    • Open your project
    • Go to File > Build Settings
    • Click "Build" (not "Build and Run")
    • Monitor the build process

Verification: Build should progress past "Compiling Assembly" within 5-10 minutes for typical projects.

Solution 2: Increase System Resources Allocation

IL2CPP + Burst 2.0 compilation is resource-intensive. Insufficient resources cause hangs.

For Memory Issues:

  1. Check Available RAM:

    • Open Activity Monitor (Mac) or Task Manager (Windows)
    • Ensure at least 8GB free RAM available
    • Close unnecessary applications
  2. Increase Unity Memory Limits:

    • Open Unity Editor
    • Go to Edit > Preferences > External Tools
    • Set "External Script Editor" memory limit higher
    • Or use command-line build with increased heap size
  3. Use 64-bit Build Process:

    • Ensure Unity is running in 64-bit mode
    • Check: Unity > About Unity should show "64-bit"
    • IL2CPP requires 64-bit for large projects

For Disk Space Issues:

  1. Check Available Disk Space:

    • Ensure at least 10GB free space on build drive
    • IL2CPP generates large intermediate files
    • Burst compilation creates temporary artifacts
  2. Change Build Location:

    • Use external drive with more space if needed
    • Go to File > Build Settings
    • Change "Build Location" to drive with more space

Verification: Build should have sufficient resources to complete compilation without hanging.

Solution 3: Fix Burst Compilation Errors

Burst compilation errors can cause silent failures that appear as hangs. Check for Burst-specific issues.

Step-by-Step Fix:

  1. Enable Burst Compilation Logging:

    • Open Unity Editor
    • Go to Edit > Project Settings > Player
    • Expand "Other Settings"
    • Under "Burst AOT Settings", enable "Enable Burst Compilation"
    • Enable "Enable Burst Compilation Logging"
  2. Check Console for Burst Errors:

    • Open Console window (Window > General > Console)
    • Look for red error messages containing "Burst"
    • Common errors:
      • "Burst compilation failed"
      • "Burst job compilation error"
      • "Unsupported code pattern in Burst job"
  3. Fix Burst Incompatible Code:

    • Burst doesn't support all C# features
    • Remove System.Reflection usage in Burst jobs
    • Remove string operations in hot paths
    • Remove try-catch blocks in Burst-compiled code
    • Use [BurstCompile] attribute correctly
  4. Disable Burst for Problematic Jobs:

    • If specific jobs cause issues, temporarily disable Burst:
      // Remove [BurstCompile] attribute
      // [BurstCompile]
      public struct ProblematicJob : IJob
      {
      // Job code
      }
  5. Test Build Again:

    • Clear cache (Solution 1)
    • Attempt build
    • Check if compilation progresses

Verification: Console should show no Burst errors, and build should progress normally.

Solution 4: Optimize IL2CPP Code Generation

IL2CPP can struggle with certain C# patterns. Optimize your code for IL2CPP compatibility.

Code Optimization Tips:

  1. Reduce Generic Type Usage:

    • IL2CPP generates code for each generic instantiation
    • Excessive generics increase compilation time
    • Use concrete types where possible
  2. Simplify Complex Expressions:

    • Break down complex LINQ queries
    • Avoid deeply nested method calls
    • Simplify lambda expressions
  3. Reduce Reflection Usage:

    • IL2CPP struggles with reflection-heavy code
    • Use code generation or direct calls instead
    • Minimize GetType(), Invoke(), and attribute queries
  4. Optimize String Operations:

    • String concatenation creates garbage
    • Use StringBuilder for multiple concatenations
    • Cache frequently used strings
  5. Reduce Assembly References:

    • Fewer assemblies = faster IL2CPP compilation
    • Remove unused package dependencies
    • Consolidate code into fewer assemblies

Verification: Code should compile faster with IL2CPP, reducing hang probability.

Solution 5: Update Unity and Burst Versions

Outdated Unity or Burst versions may have bugs causing compilation hangs.

Step-by-Step Fix:

  1. Check Unity Version:

    • Open Unity Editor
    • Go to Help > About Unity
    • Note your Unity version
    • Check Unity release notes for IL2CPP/Burst fixes
  2. Update Unity:

    • Open Unity Hub
    • Go to "Installs" tab
    • Check for updates to your Unity version
    • Install latest patch version (e.g., 2026.2.0b15 → 2026.2.0b16)
  3. Update Burst Package:

    • Open Package Manager (Window > Package Manager)
    • Find "Burst" package
    • Click "Update" if newer version available
    • Or manually update in Packages/manifest.json:
      "com.unity.burst": "1.8.15"
  4. Update IL2CPP Backend:

    • IL2CPP is part of Unity core
    • Updating Unity updates IL2CPP automatically
    • Ensure you're using latest Unity version
  5. Test Build:

    • Clear cache (Solution 1)
    • Attempt build with updated versions
    • Check if compilation progresses

Verification: Updated versions should have bug fixes that resolve compilation hangs.

Solution 6: Use Incremental Builds

Full rebuilds take longer and are more prone to hangs. Use incremental builds when possible.

Step-by-Step Fix:

  1. Enable Incremental IL2CPP:

    • Open File > Build Settings
    • Click "Player Settings"
    • Go to "Other Settings"
    • Enable "Use incremental GC"
    • IL2CPP will reuse previously compiled code
  2. Build Incrementally:

    • Make small code changes
    • Build again (should be faster)
    • Only changed assemblies recompile
  3. Clean Build When Needed:

    • If incremental builds fail, do clean build
    • Delete Library/ folder (backup first)
    • Reimport project
    • Build from scratch

Verification: Incremental builds should complete faster and reduce hang probability.

Solution 7: Monitor Build Process

Understanding where the build hangs helps identify the specific issue.

Build Monitoring Steps:

  1. Enable Detailed Logging:

    • Open Unity Editor
    • Go to Edit > Preferences > General
    • Enable "Show Compilation Time"
    • Enable "Verbose Logging" in Console
  2. Monitor Build Progress:

    • Watch Console window during build
    • Note which assembly is compiling when it hangs
    • Check for memory warnings
    • Monitor CPU and RAM usage
  3. Check Build Logs:

    • Navigate to: Library/Logs/
    • Open latest Editor.log file
    • Search for "IL2CPP" or "Burst" errors
    • Look for stack traces or error messages
  4. Identify Problematic Assembly:

    • If build always hangs on same assembly, that assembly has issues
    • Check that assembly's code for problems
    • Consider splitting large assembly into smaller ones

Verification: You should identify which assembly or step causes the hang.

Solution 8: Alternative: Use Mono Backend Temporarily

If IL2CPP continues to hang, use Mono backend temporarily to unblock development.

Step-by-Step Fix:

  1. Switch to Mono Backend:

    • Open File > Build Settings
    • Click "Player Settings"
    • Go to "Other Settings"
    • Find "Scripting Backend"
    • Change from "IL2CPP" to "Mono"
  2. Build with Mono:

    • Build should complete faster
    • Mono doesn't have IL2CPP compilation step
    • Useful for development builds
  3. Switch Back to IL2CPP for Release:

    • Use Mono for development
    • Switch to IL2CPP only for release builds
    • IL2CPP provides better performance and security

Note: Mono backend has limitations (no Burst, larger builds, platform restrictions). Use only as temporary workaround.

Verification: Build should complete successfully with Mono backend.

Prevention Tips

Avoid Future Build Hangs:

  1. Regular Cache Cleanup:

    • Clear Burst and IL2CPP cache weekly
    • Prevents cache corruption issues
  2. Monitor Code Complexity:

    • Keep assemblies reasonably sized
    • Avoid excessive generic usage
    • Simplify complex code patterns
  3. Stay Updated:

    • Update Unity regularly
    • Update Burst package when available
    • Check release notes for fixes
  4. Test Builds Frequently:

    • Don't wait until release to test IL2CPP builds
    • Test IL2CPP builds weekly during development
    • Catch issues early
  5. Use Incremental Builds:

    • Prefer incremental builds over clean builds
    • Only do clean builds when necessary
    • Saves time and reduces hang risk

Common Error Messages and Fixes

"Burst compilation failed":

  • Check Burst-compatible code patterns
  • Remove unsupported C# features
  • Update Burst package

"IL2CPP code generation error":

  • Simplify complex code
  • Reduce reflection usage
  • Check for unsupported patterns

"Out of memory during compilation":

  • Increase available RAM
  • Close other applications
  • Reduce code complexity

"Build process timed out":

  • Increase build timeout settings
  • Use incremental builds
  • Optimize code for faster compilation

Related Problems

If this fix didn't solve your issue, check these related help articles:

Still Having Issues?

If your IL2CPP + Burst 2.0 build is still stuck at "Compiling Assembly":

  1. Check Unity Forums: Search for your specific Unity version and error
  2. Review Unity Release Notes: Check for known issues in your version
  3. Try Clean Project: Create new project and import code incrementally
  4. Contact Unity Support: If issue persists, file a bug report with Unity

Bookmark this fix for quick reference - IL2CPP + Burst compilation issues can be frustrating, but these solutions should resolve most cases.

Share this article with your dev friends if it helped you get your builds working again!