- Home /
Problem Building Streamed Scene Asset Bundle
Hello everyone. I'm still fairly new to Unity, so this is likely something small I'm overlooking. I've been searching for quite a while now and haven't found anything resembling the same problem I'm having.
I'm using Unity Pro and trying save a Unity scene as a streamable .unity3d file. I've literally created a new Unity project and copied and pasted the example code provided in the scripting reference (link text) into a new script. When I try to run the script (and compile this scene, which is just the default main camera), I briefly see a popup that reads "Compiling scripts" and then it crashes.
I receive two errors:
Assets/SaveScene.js(1,2): BCE0064: No attribute with the name 'MenuItem' or 'MenuItemAttribute' was found (attribute names are case insensitive).
Error building Player because scripts had compiler errors UnityEditor.BuildPipeline:BuildStreamedSceneAssetBundle(String[], String, BuildTarget) SaveScene:MyBuild() (at Assets/SaveScene.js:4)
Does anyone have any idea what might be causing the crash? Should Unity even be trying to compile scripts that the scene isn't dependent upon?
It's been a week and no responses regarding a solution. Is anyone at least able to recreate this problem following the same steps I took (new unity project, save the default scene, copy and paste the script from the link above into a script/code file, try to build)?
Answer by snotbubblelou · Dec 13, 2011 at 08:39 AM
Unfortunately I too am having this problem. Using Unity 3.4.1 I have scenes that run fine but do not build with BuildPipeline.BuildStreamedSceneAssetBundle or BuildPipeline.BuildPlayer. Yet I have tried to build a single empty scene. I receive these errors.
Assets/Scripts/exporting/AutomatedExportResources.js(1,2): BCE0064: No attribute with the name 'MenuItem' or 'MenuItemAttribute' was found (attribute names are case insensitive). and
Error building Player because scripts had compiler errors UnityEditor.BuildPipeline:BuildPlayer(String[], String, BuildTarget, BuildOptions)
The compile process appears to be building much more than I anticipate for the empty scene. Is there a way to print or view the dependancies that the build methods BuildStreamedSceneAssetBundle or BuildPipeline.BuildPlayer are gathering?
Answer by caesarhernandez · Jan 25, 2013 at 08:34 PM
Hi Guys,
I have figured this out. What you have to do is pick the menu item that was created by your script, then BEFORE you select your scene to build the asset bundle for, you have to go back and comment out all of the script in the .cs or .js file that builds the menu items in your UI. What's happening is the unity player is trying to compile the script and it is not working. If you comment it out before it builds the asset bundle, it won't see the script and therefore, won't error out.
Your answer
Follow this Question
Related Questions
Why does a scene loaded from an Asset Bundle returns empty string when getting its name? 0 Answers
How to get the names of scene in AssetBundle? 1 Answer
How do I load an entire scene using Assetbundles? 1 Answer
How to create and load an assetBundle containing many scenes and dependancies ? 0 Answers
'Resource file has already been unloaded' error when exiting application in Editor 1 Answer