Hello! I'm developing an app in Unity 2018.3.2f1, building for android was kinda painful, but we've managed and it's on Play Store currently. My biggest issue happens on iOS, where I get the following errors when running it on an Iphone 6S, connected to Xcode, etcetera. My bundles for iOS are being generated for the iOS platform already and are stored on firebase and get loaded through an URL, other links pointing to files (such as a .pdf for example) seem to work fine, so I'm assuming that the error lies on generating the bundles. Any help is honestly apreciated. Code (CSharp): 16:25:38.537595 -0300 SENAI-RA Failed to decompress data for the AssetBundle 'rs_mecatronica'. UnityEngine.AssetBundle:LoadFromFile(String) AssetBundleManager:LoadFile() UnityEngine.Events.UnityEvent:Invoke() UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() UnityEngine.EventSystems.StandaloneInputModule:Process() System.Threading.Interlocked:CompareExchange(T&, T, T) System.Threading.Interlocked:CompareExchange(T&, T, T) System.Threading.Interlocked:CompareExchange(T&, T, T) [ line 445] (Filename: Line: 445) padrão 16:25:38.548193 -0300 SENAI-RA Failed to load AssetBundle! UnityEngine.Debug:LogErrorFormat(Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) UnityEngine.Events.UnityEvent:Invoke() UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() UnityEngine.EventSystems.StandaloneInputModule:Process() System.Threading.Interlocked:CompareExchange(T&, T, T) System.Threading.Interlocked:CompareExchange(T&, T, T) System.Threading.Interlocked:CompareExchange(T&, T, T)
As far as I've tested, it doesn't looks like it. Sorry. I have a lot of AssetBundles in my project, all of them are created under this script. Code (CSharp): using UnityEditor; using System.IO; public class CreateAssetBundle { [MenuItem("Assets/Build AssetBundles")] static void BuildAllAssetBundles() { string assetBundleDirectory = "Assets/AssetBundles"; if (!Directory.Exists(assetBundleDirectory)) { Directory.CreateDirectory(assetBundleDirectory); } BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, BuildTarget.iOS); } }
But does this error happen reliably regardless of where the bundle in question is placed, redownloaded etc.?
The AssetBundle is currently being placed in the persistent data path, it works just fine on Android. Should I use another path on iOS? Thank you! Also, we're building separate bundles for Android and iOS.
Oddly, that solved it. But somehow, when loading the AssetBundle on iOS, it crashes due to memory usage issues. The same AssetBundles load up just fine on Android, even if they do take a while to do that.
Well, that's what I meant with "corrupted file". The bundle was somehow damaged during transfer to device. That isn't necessarily a fair comparison. Do both platforms are 64-bit builds, for example? How much memory does it use on Android and how much on iOS at the moment of crash?
I ran a memory diagnostics on Android, it seems to be... quite a large amount of memory. Im running the APP on an iphone 5S, which has only 1GB of RAM... makes sense that it would crash. Is there a way to make my assetbundles lighter memory-wise? Most of them dont even have 100MB in size. EDIT: I think this diagnosis could also help, my application is at the top
For anyone having this issue on the future, I found no other fix than to limit my minimum iOS version to 11. Older phones just seem to have a hard time decompressing large AssetBundles.