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
1
Question by paramburu · Jan 31, 2017 at 08:33 PM · errorwebglload sceneassetbundles

WebGL error: "Could not produce class with ID 0"

Hi, I am working on a WebGL project with asset bundles. Everything seems to work but I am getting the following error even when I disable 'Strip Engine Code'. Any thoughts? I don't find any reference to a class with ID 0.

blob:http://localhost:8000/d89a9c3f-9b5c-49a3-8e70-0ca3b59f0227:8336 Could not produce class with ID 0. This could be caused by a class being stripped from the build even though it is needed. Try disabling 'Strip Engine Code' in Player Settings.

(Filename: /Users/builduser/buildslave/unity/build/Runtime/Serialize/PersistentManager.cpp Line: 1323)

Comment
Add comment · Show 6
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
avatar image DSL-TailorIt · Feb 09, 2017 at 08:24 AM 0
Share

I'm assu$$anonymous$$g that you mean that this happnens when you enable Strip Engine Code (and not disable).

When this has happened to me I had to guess exactly which code was being stripped, and it could be something basic like $$anonymous$$eshRenderer or something like that.

In short, there's a component (it could be any) you're including in an AssetBundle that is NOT in any asset/gameobject that's being used directly in the editor. By not being in the editor, it is stripped and excluded from the WebGL build.

For example, you may have all your 3D models in assetbundles and none in the editor directly. That would make $$anonymous$$eshRenderer be stripped. When you would load your assetbundles, there would be a reference to $$anonymous$$eshRenderer that is not included in the build.

There are a few possible solutions:

  • Place an empty gameobject with the missing component in the scene

  • Place this same gameobject in the Resources folder (haven't tested this one, but should work)

Of course, this does not answer your original question, since I also have no idea how to deter$$anonymous$$e exactly which class is missing (beyond manually checking). Hopefully it helps though.

avatar image paramburu DSL-TailorIt · Feb 20, 2017 at 06:46 PM 0
Share

Thanks @DSL-TailorIt, sorry for the delay.

Unfortunately, this also happens when Strip Engine Code is not enabled.

In theory, the ID should map to the ones in https://docs.unity3d.com/$$anonymous$$anual/ClassIDReference.html

But since there is no class with ID 0, I don't know what to add to the link.xml file.

I am using ParticleSystem and Animator and they seem to be missing in the build so I have added them but still nothing.

 <linker>
     <assembly fullname="UnityEngine">
         <type fullname="UnityEngine.$$anonymous$$eshRenderer" preserve="all"/>
         <type fullname="UnityEngine.Sprite" preserve="all"/>
         <type fullname="UnityEngine.SpriteRenderer" preserve="all"/>
         <type fullname="UnityEngine.ParticleSystem" preserve="all"/>
         <type fullname="UnityEngine.Animator" preserve="all"/>
         
         <type fullname="UnityEngine.GameObject" preserve="all"/>
         <type fullname="UnityEngine.Texture2D" preserve="all"/>
     </assembly>
 </linker>

I even tried building with the pre-built engine and still the same issue but with class ID 1049652922.


Well, I have been adding things non-stop to the link.xml file and the missing Particles seem to be back but I am still missing an animated piece of mesh. I guess I'll have to keep adding things until it shows.

Thanks for your time.

avatar image DSL-TailorIt paramburu · Feb 21, 2017 at 08:05 AM 0
Share

Hello again!

I don't see $$anonymous$$eshFilter in the X$$anonymous$$L. Could that be it? It's a commonly used component.

Also, if you're using an animated mesh, could you be missing Skinned$$anonymous$$eshRenderer?

Like I said, it's a guessing game :-) Good luck.

Show more comments
avatar image DSL-TailorIt · Mar 08, 2017 at 08:43 AM 0
Share

When I recently added an animated character to my project, this error showed up again.

This time the missing class was UnityEngine.Avatar (after a lot of trial/error). Upon closer inspection, it should be noted that the Animator component does have a reference to Avatar, so I guess that makes sense. Still, this might help someone who has the same problem.

avatar image Milchbar · May 17, 2017 at 11:31 AM 0
Share

Have the same error and can't find what class 0 should be. Have you found out? All other classes are listed here: https://docs.unity3d.com/$$anonymous$$anual/ClassIDReference.html

3 Replies

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

Answer by paramburu · May 17, 2017 at 03:46 PM

Hi, just to share what I ended up doing, maybe it can help you @Milchbar.

What I noticed was that I was missing some particles, so what I did was start adding as much namespaces related to particles I could think of. That solved the issue but then I started commenting out to see which were really necessary.

 <linker>
     <assembly fullname="UnityEngine">
         <type fullname="UnityEngine.MeshRenderer" preserve="all"/>
         <type fullname="UnityEngine.SkinnedMeshRenderer" preserve="all"/>
         <type fullname="UnityEngine.MeshFilter" preserve="all"/>
         <!--<type fullname="UnityEngine.MeshCollider" preserve="all"/>-->
         <!--<type fullname="UnityEngine.BoxCollider" preserve="all"/>-->
         <!--<type fullname="UnityEngine.Sprite" preserve="all"/>-->
         <!--<type fullname="UnityEngine.SpriteRenderer" preserve="all"/>-->
         <!--<type fullname="UnityEngine.ParticleAnimator" preserve="all"/>
         <type fullname="UnityEngine.ParticleEmitter" preserve="all"/>-->
         <type fullname="UnityEngine.PhysicMaterial" preserve="all"/>
         <type fullname="UnityEngine.ParticleSystemRenderer" preserve="all"/>
     </assembly>
 </linker>


I figured that the particles were the issue because I had two particle emitters and got two "Could not produce class with ID 0" errors on the log.

Hope it helps.

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
avatar image
0

Answer by deniskrop · May 09, 2017 at 04:19 AM

I have the same issue with class 1049652922 - how did you go about including the UnityEngine.Avatar class?

Comment
Add comment · Show 1 · 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
avatar image DSL-TailorIt · May 09, 2017 at 07:26 AM 0
Share

Hello there!

I'm not sure if your question was directed at me, but to simply answer your question you can create a file called link.xml, place it in your "Assets" folder and put the following in it:

 <linker>
     
     <assembly fullname="UnityEngine">
         
         <type fullname="UnityEngine.Avatar" preserve="all"/>
         
     </assembly>
     
 </linker>


Unfortunately, I'm not sure that that class ID corresponds to Avatar. It may be some other class. There's a bit of trial and error involved in deter$$anonymous$$ing which class is being "incorrectly" stripped.

Further reading:

  • https://docs.unity3d.com/$$anonymous$$anual/iphone-playerSizeOptimization.html (ignore the fact that this page is mainly for iPhone; the content about link.xml is consistent with other platforms, as far as I know)

  • https://forum.unity3d.com/threads/what-is-the-syntax-of-link-xml-file.221867/

avatar image
0

Answer by Milchbar · May 17, 2017 at 01:38 PM

Have the same error and can't find what class 0 should be. Have you found out? All other classes are listed here: https://docs.unity3d.com/Manual/ClassIDReference.html

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

110 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 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 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 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 avatar image avatar image

Related Questions

uncaught exception: abort(132) WebGL 1 Answer

way my game is not working after build to WebGL? 0 Answers

Cannot Export to WebGL because of il2CPP stops working. 2 Answers

Why does my audio work fine in the editor but doesn't play in the WebGL build? 1 Answer

Problem with webgl building 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