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

Asset bundle can't be the same name?

Discussion in 'Editor & General Support' started by Matt-Jian, Jul 13, 2013.

  1. Matt-Jian

    Matt-Jian

    Joined:
    Aug 20, 2012
    Posts:
    2
    Hi, I have two different files in different folders: one is audio, in audio folder like audio/base.mp3, the other is fx, placed in fx folder like fx/base.prefab. I use unity3d to build these two files to asset bundles, so they have the same name base.assetbundle, but in different folder, audio/base.assetbundle, another fx/base.assetbunlde.
    When I load them in Windows version game, I get error "The asset bundle XXX can't be loaded because another asset bundle with the same files are already loaded".
    So in unity3d we can't use the same name for asset bundle? even they are in different folders?
    It's resonable?


    PS:
    1. I know we can't load two bundles which have the same resource / id but just rename it.
    2. I‘d like to cache bundles and not use AssetBundle.unload(false)
     
    Last edited: Jul 14, 2013
  2. fullike

    fullike

    Joined:
    Nov 13, 2012
    Posts:
    17
    I met the same problem

    I want to use AssetBundle.CreateFromMemoryImmediate to solve this problem, but got the same error:
    The asset bundle <unknown> can't be loaded because another asset bundle with the same files are already loaded

    Is there anyway to 'set' bundle name before or after AssetBundle.CreateFromMemoryImmediate?

    I have a lot of small bundles in different folders, many of them have same name, even with different extensions. That's important for me.
     
  3. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    Hi,

    Could you please file a bug report and we will look in to it.
     
  4. Deleted User

    Deleted User

    Guest

    In 4.x, we used the last component of the AssetBundle path as the internal name, this led the conflict. If you create from memory, "unknown" will be used as the internal name instead.

    In 5.0, you can set a relative path as the AssetBundle name, just like audio/base.assetbundle, the whole relative path will be used as the internal name, it solved the problem.