Search Issue Tracker
By Design
Votes
0
Found in
2021.2
2021.2.13f1
2021.3
2022.1
2022.2
Issue ID
1407312
Regression
No
Scripts within Assembly Defintions are missing when used by scenes in Asset Bundles and when the Project is built using IL2CPP
Reproduction steps:
1. Open users attached project
2. Press Tools > Build App
3. Open the built project in <Project folder>/Builds/Test
Expected result: No errors in the Player
Actual result: "The referenced script on this Behaviour is missing!" errors are thrown
Reproducible with: 2021.2.19f1, 2021.3.0f1, 2022.1.0b15, 2022.2.0a9
Could not test with: 2019.4.37f1 (could not downgrade the project), 2020.3.33f1 (ArgumentException: Unhandled ManagedStrippingLevel value of 4)
Notes:
-only reproducible with IL2CPP scripting backend
-on windows, you might need to rename <Project folder>/Builds/Test to <Project folder>/Builds/Test.exe
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2022.2.X):
On IL2CPP builds managed code stripping is enabled - https://docs.unity3d.com/Manual/ManagedCodeStripping.html - and is removing these scripts since they are in a package and nothing in the build is referencing them. To prevent this from happening please use the BuildPlayer overload that takes a BuildPlayerOptions object and set the assetBundleManifestPath to the path to your StreamingAssets.manifest file - https://docs.unity3d.com/ScriptReference/BuildPlayerOptions-assetBundleManifestPath.html. This ensure that all of the scripts referenced in the streaming assets are found.