Search Issue Tracker
[IL2CPP][iOS] Asset Bundle loading assemblies are stripped if there are no MonoBehaviours in the project
If there are no MonoBehaviours (C# scripts deriving from MonoBehaviour) in the Project, Asset Bundles cannot be loaded on iOS.
Steps to reproduce:
1) Open the attached project.
2) Delete /Assets/Scripts folder.
3) Switch platform to iOS.
4) Go to ASSETBUNDLES > Build Asset Bundles.
5) Build the project for iOS.
6) Run on a device.
Error is logged in Xcode's console:
Unable to load asset bundle: /var/containers/Bundle/Application/39871C90-61A0-4512-9F05-431E44BD02AB/assetbundles.app/Data/Raw/testbundle
This indicates that Asset Bundle can't be loaded.
The project uses a managed DLL instead of a regular script to load the bundles. Apparently, Asset Bundle assemblies are stripped when there are no MonoBehaviour scripts in the project. Scripts that don't derive from MonoBehaviour don't prevent the bug from happening.
This doesn't occur when Engine Code Stripping is disabled, or when Mono2x Scripting API is used. Does not reproduce on Android.
Note: the DLLs are not stripped since they are used to log the aforementioned error message.
2017.1.0a3, 5.5.1f1, 5.4.5f1, 5.3.7p4
iPhone 7 iOS 10.3
LG Nexus 5 Android 6.0.1
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Textures] CubemapArray API forces duplicate code because you cannot access individual cubemaps directly
- Duplicating a Prefab instance in the Scene will cause instances of the same Prefab to be disabled and re-enabled
- GUI.Button and GUILayout.Button stay in the normal GUIStyleState even when the normal GUIStyleState is changed to another one
- Particle System mesh UV coordinates change when mesh's geometry layout is changed on import
- [Windows] The Unity import progress is not shown in the Windows taskbar