Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Error loading AssetBundle from StreamingAssets folder on iOS

Discussion in 'Editor & General Support' started by ratmat2002, Mar 25, 2016.

  1. ratmat2002

    ratmat2002

    Joined:
    Jun 13, 2014
    Posts:
    35
    I'm unable to load AssetBundles built with BuildAssetBundleOptions.ChunkBasedCompression and placed in the StreamingAssets folder when running on iOS. The same AssetBundle loads properly when running in the OSX Editor. I have verified proper building and placement of the bundle. All bundles downloaded using WWW.LoadFromCacheOrDownload built at the same time work properly

    The error received in the XCode output log when running on a iOS device is:

    Unable to open archive file: /var/containers/bundle/application/9c2e7214-9980-4ea6-a8b8-1554f5cc0c9a/myvegas.app/data/raw/mybundle.unity3d

    Here is the code being used to load the bundle. According to the docs here http://docs.unity3d.com/Manual/StreamingAssets.html, it's best to use Application.streamingAssetsPath to get the location of the StreamingAssets folder and I assume this also means when running on iOS devices.

    AssetBundleCreateRequest abcr = AssetBundle.LoadFromFileAsync(Application.streamingAssetsPath + "/mybundle.unity3d");

    yield return abcr;

    if (abcr.assetBundle == null)
    {
    Debug.LogError("Error loading bundle mybundle.unity3d");
    }

    When running on iOS, I have also tried replacing Application.streamingAssetsPath with:

    Application.dataPath + "/Raw/"

    but the same error occurs.

    This same error exists on all versions of Unity from 5.3.2p4 through 5.3.4p1.

    I have seen some references to this issue in the forums but no formal response from Unity nor any specific confirmation that there is a resolution.

    Is there any fix for this issue? It's a show-stopper for the use of including AssetBundles in the iOS binary.
     
    Last edited: Mar 26, 2016
  2. Deleted User

    Deleted User

    Guest

  3. ratmat2002

    ratmat2002

    Joined:
    Jun 13, 2014
    Posts:
    35
  4. Deleted User

    Deleted User

    Guest

    Ok, could you please open a bug with repro project for it? Thanks.