# IL2CPP error: Managed/UnityEngine.dll is not available for codegen. This can happen if the IL2CPP backend is missing or corrupted.

- **ID:** `unity/il2cpp-codegen-managed-backend-unavailable`
- **Domain:** unity
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

The IL2CPP code generation backend cannot locate the managed UnityEngine.dll, often due to incomplete installation or corruption of Unity's IL2CPP support package.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Unity 2021.3.0f1 | active | — | — |
| Unity 2022.3.0f1 | active | — | — |
| Unity 2023.2.0f1 | active | — | — |
| Unity 2024.1.0b1 | active | — | — |

## Workarounds

1. **Reinstall the IL2CPP package via Unity Hub: Open Unity Hub, select the project's Unity version, click 'Manage Modules', ensure 'Windows Build Support (IL2CPP)' or equivalent is checked, then apply changes.** (85% success)
   ```
   Reinstall the IL2CPP package via Unity Hub: Open Unity Hub, select the project's Unity version, click 'Manage Modules', ensure 'Windows Build Support (IL2CPP)' or equivalent is checked, then apply changes.
   ```
2. **Manually repair Unity installation by running the Unity installer's repair option: Uninstall Unity version via Control Panel, then reinstall from Unity Hub with IL2CPP support included.** (90% success)
   ```
   Manually repair Unity installation by running the Unity installer's repair option: Uninstall Unity version via Control Panel, then reinstall from Unity Hub with IL2CPP support included.
   ```

## Dead Ends

- **Reimport all assets via Assets -> Reimport All** — Reimporting assets does not repair the IL2CPP backend installation; it only refreshes asset metadata. (95% fail)
- **Delete Library folder and restart Unity** — Deleting Library removes cached data but does not fix missing IL2CPP components in the Unity installation. (80% fail)
- **Switch to Mono scripting backend and back to IL2CPP** — This may trigger a rebuild but does not address underlying corruption of the IL2CPP package. (70% fail)
