I have a project with Vuforia in it, I just updated it hoping that it would fix the issue (updated to 7-2-24). I'm learning to code and do all of this and I came to an error that I cannot figure out the relation to what I have just done. I'm trying to create an assetbundle. The code to create the assetbundle is pretty much exactly as found on the Unity Database.
using UnityEditor; using System.IO; public class CreateAssetBundles { [MenuItem("Assets/Build AssetBundles")] static void BuildAllAssetBundles() { string assetBundleDirectory = "Assets/ABtoExport"; if (!Directory.Exists(assetBundleDirectory)) { Directory.CreateDirectory(assetBundleDirectory); } BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.UncompressedAssetBundle, EditorUserBuildSettings.activeBuildTarget); } }
https://docs.unity3d.com/Manual/AssetBundles-Workflow.html
Now, when I go to Assets -> Build AssetBundles, instead of doing anything I get 10 errors from Unity all in the Vuforia scripts. When I comment out the BuildPipeline.BuildAssetBundles line I get no errors (and of course, nothing happens) but I don't see what one has to do with the other.
Assets/Vuforia/Scripts/DefaultInitializationErrorHandler.cs(10,7): error CS0246: The type or namespace name `Vuforia' could not be found. Are you missing an assembly reference? Assets/Vuforia/Scripts/DefaultTrackableEventHandler.cs(10,7): error CS0246: The type or namespace name `Vuforia' could not be found. Are you missing an assembly reference? Assets/Vuforia/Scripts/DefaultInitializationErrorHandler.cs(18,50): error CS0246: The type or namespace name `VuforiaMonoBehaviour' could not be found. Are you missing an assembly reference? Assets/Vuforia/Scripts/DefaultTrackableEventHandler.cs(18,60): error CS0246: The type or namespace name `ITrackableEventHandler' could not be found. Are you missing an assembly reference? Assets/Vuforia/Scripts/DefaultInitializationErrorHandler.cs(22,46): error CS0246: The type or namespace name `VuforiaUnity' could not be found. Are you missing an assembly reference? Assets/Vuforia/Scripts/DefaultInitializationErrorHandler.cs(101,23): error CS0246: The type or namespace name `VuforiaUnity' could not be found. Are you missing an assembly reference? Assets/Vuforia/Scripts/DefaultTrackableEventHandler.cs(22,15): error CS0246: The type or namespace name `TrackableBehaviour' could not be found. Are you missing an assembly reference? Assets/Vuforia/Scripts/DefaultTrackableEventHandler.cs(50,9): error CS0246: The type or namespace name `TrackableBehaviour' could not be found. Are you missing an assembly reference? Assets/Vuforia/Scripts/DefaultTrackableEventHandler.cs(51,9): error CS0246: The type or namespace name `TrackableBehaviour' could not be found. Are you missing an assembly reference? Error building Player because scripts had compiler errors
Since they are Vuforia scripts I absolutely do not touch them. And everything seems to run fine when I remove the Unity provided assetbundle script, but why would assetbundles not work with Vuforia also being in the project? I'm positive I'm overlooking something. Any help, please?