Search Issue Tracker
By Design
Votes
0
Found in
2020.3.3f1
2023.2.0a1
Issue ID
UUM-1302
Regression
No
"script ... is missing!" error in player when PlayableDirector used in AssetBundle, but not player (code stripping)
Reproduction steps:
# Open the attached project from Google Drive (Ritter.zip)
# Open the custom build UI (Build menu)
# Make sure IL2CPP forced and Full Asset Bundles selected
# Press Build -> Build And Run
# Open the player logs
!Repro.png!
Expected result: Player Build runs without errors
Actual result: Errors in player.log: The referenced script (Unknown) on this Behaviour is missing!
The referenced script on this Behaviour (Game Object '<null>') is missing!
Note: the project is built using IL2CPP (This error isn't present in the mono version of the project)
Reproducible with: Timeline 1.4.8 (2020.3.32f1), 1.5.2 (2020.3.32f1), 1.7.1 (2020.3.32f1)
Could not test with: 2019.4.37: Custom packages errors - The type or namespace name 'ScriptedImporter' could not be found (are you missing a using directive or an assembly reference?) etc.
2021.2.17f1: Custom packages errors: multiple scripts console errors: error CS0518: Predefined type 'System.Index' is not defined or imported, error CS0656: Missing compiler required member 'System.Index..ctor'
2022.1.0b13, 2022.2.0a8: RenderTarget already allocated error (Custom package error)
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
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
- Mouse and Pointer Events are called incorrectly in ScrollView with XRUIInputModule
- Memory leak occurs when repeatedly minimizing and maximizing the UI Builder window
Resolution Note:
The cause of the "missing" errors was because of IL2CPP code stripping, which cannot be disabled in 2020.3. It was removing classes that were only referenced from the AssetBundles in the project, not by the player build itself.
The way to fix this problem is to specify the path to the .manifest file of the manifest assetbundle. e.g. adding this code prior to calling BuildPlayer()
buildOptions.assetBundleManifestPath = AssetBundlesBuildPath + "/" + AssetBundlesBuildPath + ".manifest";
There is some documentation for this file and its use with stripping in https://docs.unity3d.com/2023.1/Documentation/Manual/AssetBundles-Building.html
We plan to improve some build warnings in this area to help make it easier to debug in this area.