Search Issue Tracker
By Design
Votes
0
Found in
6000.0.56f1
6000.2.1f1
6000.3.0a5
Issue ID
UUM-114706
Regression
No
"Failed to load il2cpp" error when running a standalone build that uses static libraries
How to reproduce:
1. Open the project “IN-112335_StaticLibIssue”
2. File → Build and Run
3. Observe the result
Expected result: The standalone build opens without any errors
Actual result: Error window appears with the message “Failed to load il2cpp”
Reproducible with: 2023.1.0a1, 6000.0.56f1, 6000.2.1f1, 6000.3.0a5 (36d7e9fd6645)
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
* The project builds without errors, but the error appears when the standalone build is launched
* No Player.log is created
* The project uses --linker-flags-file for some static libraries
* Prerequisites:
** In the Unity project, Edit → Project Settings → Player → Other Settings → Configuration
** Scripting Backend → IL2CPP
** C++ Compiler Configuration → Release
** Under Script Compilation → Scripting Define Symbols → add “EADPUNITY_USE_STATIC_LIB”
* The issue also reproduces when running the solution file (.sln), to run the file in Visual Studio 2022:
** File → Build Profiles → Create Visual Studio Solution
** Click Build
** Open Visual Studio 2022 → Open a project or solution → select the .sln file in the build directory
** Build the project with the x64 configuration
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Metal: Fragment shader missing texture binding at index 0 (_MainTex / Hidden/Preview Alpha)” warnings are thrown when selecting some TextMesh Pro Font Assets
- [Android] A VideoClip does not play on some Android devices
- Intercepted Events text is hardly visible in Inspector window for UI elements when Editor theme is set to Light
- [Hierarchy V2] Add new Query Block window contains a typo in the Hierarchy Search Area block
- Scene is not rendered in Player when ran with -force-d3d12 argument and GPU Resident Drawer enabled
Resolution Note:
This particular user project actually links a dynamic library to the player's game library, but does not have logic to copy the dynamic library to the built player folder. Without the dynamic library dependency satisfied, the game library can not be loaded at startup and the player process exits immediately. For IL2CPP builds the simplest solution is to copy the required dlls to the root folder of the player.
One way to see the dll dependencies if to run the following command...
dumpbin.exe /dependents GameAssembly.dll