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

Creating Bundle Asset - Can't build bundle Uncompressed - "expected id 'UnityRaw'"

Discussion in 'Editor & General Support' started by bigorangemachine, Jul 3, 2016.

  1. bigorangemachine

    bigorangemachine

    Joined:
    Jul 3, 2016
    Posts:
    2
    I'm trying to create a bundle for a mod I'm updating. I've figured out how to create a bundle using the unity editor.

    When I import the bundle into the game (at Runtime) I get the error

    This AssetBundle was not created with UncompressedAssetBundle flag, expected id 'UnityRaw', got 'UnityFS'

    In the C# Code I have

    AssetBundle.CreateFromFile(filePath);

    I use the BuildAssetBundles as the following:

    namespace UnityEditor
    {
    public class CreateAssetBundle
    {
    [MenuItem("Tests/Create/Create From Asset Database")]
    public static void CreateNewAssetBundleFromAssetDatabase()
    {
    string outputPath = "AssetBundles";
    BuildPipeline.BuildAssetBundles(outputPath, BuildAssetBundleOptions.UncompressedAssetBundle | BuildAssetBundleOptions.ForceRebuildAssetBundle);
    }
    }

    }

    I've noticed one shader in the bundle does have an option to build & generate code but I don't think thats the issue. I'm very new to Unity and C# so its possible I've overlooked something.

    I'm using Unity 5.3.5f1 - Personal
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,555
    Did you try to rebuild the asset bundle with different flags? e.g: only with UncompressedAssetBundle ?

    Also (seems silly) but are you sure you are loading the correct bundle ?
     
  3. bigorangemachine

    bigorangemachine

    Joined:
    Jul 3, 2016
    Posts:
    2
    Ya that I made sure of. Believe me i am n00b enough to make that mistake; but i was able to change the contents of the file to get a different error