Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by anderas · Sep 07, 2015 at 10:33 AM · unity5assetbundle

Difference in script compilation in BuildStreamedSceneAssetBundle vs BuildAssetBundles

I am trying to port some code from the Unity4 AssetBundle build system to the new one. My goal is to build some scenes into their own bundles. This worked well using

 BuildPipeline.BuildStreamedSceneAssetBundle(levels, outputPath, BuildTarget.StandaloneWindows);

Now, I tried to do the same with the new system, i.e. I added respective scene to a bundle and tried to build it using

 BuildPipeline.BuildAssetBundles("Assets/AssetBundleOutput");

The problem is that I get the following error:

 Error building Player because scripts had compiler errors

The compiler error is:

 Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
   at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
   at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
   at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

My project uses some (native and managed) DLLs that work fine in a normal x86 build.

What can generally cause this kind of build error? The strangest thing seems to be that the old-style build works fine, but the new bundle system doesn't.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by anderas · Sep 07, 2015 at 10:40 AM

After reading up on the new build command, I noticed that I was missing the build target:

 BuildPipeline.BuildAssetBundles("Assets/AssetBundleOutput",BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows);

In case anybody from Unity reads this, please see it as a suggestion to improve your compiler errors! (E.g. mention what assembly is actually the problem, there are some in my project that won't work in the web player, which would have been a nice hint...)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Loading scene from bundle in Unity5 appears empty 0 Answers

Is Assetbundle.LoadAsset & LoadAllAsset thread safe in Unity5.2.4? 0 Answers

www class download local file (Windows Universal Platform - Hololens) 1 Answer

Error FMOD::Sound instance - no sound is being played from AssetBundle 0 Answers

AssetBundles miss static property 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges