Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

AssetBundle must not have any associated data at the initialization stage!

Discussion in 'Scripting' started by pixelshader, Jul 29, 2016.

  1. pixelshader

    pixelshader

    Joined:
    Dec 14, 2012
    Posts:
    17
    Has anyone scene this error?
    I ve been trying to figure out what it means from forums or documentation.

    I am loading an assetbundle from a local file using LoadFromFileAsync
    and loading items using

    assetBundle.LoadAssetWithSubAssetsAsync(item,typeof(GameObject));

    it just pops this error time to time, not always, usually works,
    but its Unity, you never know...
     
    amcakebread likes this.
  2. ThiagoSCF

    ThiagoSCF

    Joined:
    Oct 24, 2012
    Posts:
    14
    I am getting the same error when importing assetbundles from local files using an editor script.

    Did you find a solution for this?
     
    amcakebread likes this.
  3. Cynikal

    Cynikal

    Joined:
    Oct 29, 2012
    Posts:
    122
    You're calling "item" which is a form of data, yes?

    The wiki says: "public AssetBundleRequest LoadAssetWithSubAssetsAsync(string name, Type type);"

    which it needs a string..instead of data. so "item".
     
  4. amcakebread

    amcakebread

    Joined:
    Nov 8, 2016
    Posts:
    28
    I am having the same problem - are you aware of a solution to this yet?
     
  5. Deleted User

    Deleted User

    Guest

    I solved it by call "AssetBundle.UnloadAllAssetBundles(true); " before load assetBundle
     
    ruudvangaal and jipsen like this.
  6. ruudvangaal

    ruudvangaal

    Joined:
    May 15, 2017
    Posts:
    27
    Indeed it seems like if the AssetBundle was already loaded, you get this error when trying to load it again.