- Home /
Prefab in my asset bundle for iOS gets corrupted and doesn't show in the app
I have a prefab container that loads a bunch of child prefabs from an asset bundle and displays them on the screen. All of my child prefabs just have UI assets in them (panels, images, buttons, etc...) When I test in the Unity editor, everything works fine. My Asset Bundles are stored in an uncompressed format for the Unity editor but my iOS asset bundles are stored on our server. When I test the same functionality on iOS devices, the same prefab from the asset bundle inevitably throws this error (bear in mind this can happen on the first time that screen is loaded or the tenth, it's not consistent):
[Error] The file 'none' is corrupted! Remove it and launch unity again!
[Position out of bounds!]
UnityEngine.Object:Instantiate(Object)
adquizition.quizapp.<_setupPanels>c__Iterator3B:MoveNext()
Before that error appears, all of my UI in that prefab has the following warning about scripts missing:
[Warning] The referenced script on this Behaviour (Game Object 'Text') is missing!
UnityEngine.AssetBundleRequest:get_asset()
adquizition.quizapp.<_setupPanels>c__Iterator3B:MoveNext()
You can swap out 'Text' for "image', 'Button', etc...
I tried rebuilding the asset bundle containing that prefab and changing the prefab. Still have the same problem. I thought maybe because it's on iOS, the scripts are somehow getting stripped (which doesn't seem to be the case because it does usually work a few times before it errors out on me). So I put the following lines in my link.xml:
<assembly fullname="UnityEngine" preserve="all">
<namespace fullname="strange.*" preserve="all"/>
<namespace fullname="adquizition.quizapp.*" preserve="all"/>
</assembly>
<assembly fullname="UnityEngine.UI" preserve="all"/>
That didn't work either. I am very unsure as to why my scripts are missing and why this error keeps happening only for this prefab and none of the other child prefabs in that asset bundle.
Any help regarding this issue would be extremely great!
Your answer
Follow this Question
Related Questions
Project Solution | Architecture | Scenes and Views 1 Answer
Loading game objects dinamycaly 1 Answer
How can I reference objects from a different Asset Bundle ? 0 Answers
How do you package/retrieve Asset Bundle Dependencies 0 Answers
Getting errors trying to load asset bundle, help appreciated 0 Answers