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. Dismiss Notice

Asset bundle creation

Discussion in 'Scripting' started by tawdry, Jun 22, 2018.

  1. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,356
    Trying to create a asset bundle by following these directions(https://docs.unity3d.com/550/Documentation/Manual/BuildingAssetBundles.html) but get this error.
    AssetBundle names "structures.1" and "structures" can't exist in the same build as "structures.1" has the variant.
    UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTarget)
    CreateAssetBundles:BuildAllAssetBundles() (at Assets/!!0myscripts/Editor/CreateAssetBundles.cs:8)




    Code (CSharp):
    1. using UnityEditor;
    2.  
    3. public class CreateAssetBundles
    4. {
    5.     [MenuItem ("Assets/Build AssetBundles")]
    6.     static void BuildAllAssetBundles ()
    7.     {
    8.         BuildPipeline.BuildAssetBundles ("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.StandaloneOSXUniversal);
    9.     }
    10. }
    11.  
     
  2. HWIvan

    HWIvan

    Joined:
    Jan 21, 2019
    Posts:
    12
    For anyone who gets here from Google: if you have a bundle without a variant ("structures"), you can't also have one with a variant ("structures.1").

    You'll need to make "structures" be "structures.default" or something so they both have a variant set.