Search Issue Tracker

Fixed in 2017.2.0f3



Found in


Issue ID




[Unet] Error: Assertion failed on expression: 'asset->mainRepresentation.type == TypeOf<GameObject>()' on build Standalone



This happens on all Multiplayer projects upgraded from 5.4. If you remove Library folder - this problem will gone. If you change Player object (for example remove some component) - this problem will gone.

2. How we can reproduce it using the example you attached
1 Open attached project and scene "sc1"
2 Press in menu File->Build and Run, select Standalone as build target and set name for the build and press "Build and Run"-button
Actual result: in the middle of the build process - this error should appear:
"Assertion failed on expression: 'asset->mainRepresentation.type == TypeOf<GameObject>()'

3 Find Player object prefab (it is called "Cube") in Project view and remove some component
4 Try to "Build and Run" again - it will be built without errors

Comments (8)

  1. CurtisMcGill

    Dec 12, 2017 20:54

    Deleting Library Folder DOES NOT make you RESTART

    1) Exit Unity.
    2) Delete or move the directory to a safe location.
    3) Run Unity
    4) It will REBUILD the Library Folder.

  2. hardcorebadger

    May 08, 2017 16:18

    Deleting your library doesn't restart your project - it's just the unity cache files - all of "your project" is in the assets folder.

  3. WilmuClass

    Feb 16, 2017 05:28

    Yes there is. I just fixed the issue by opened the [Camera Rig], Camerea(Head), Camera (Eye), and then pressed on collapse. The error is gone. GL all.

  4. Morning_Fun_Game

    Jan 20, 2017 18:00

    It came out this issue when I using EditorPrefs.DeleteAll ( ).
    Please fix it.

  5. MrLucid72

    Nov 08, 2016 17:28

    Happens to me on Windows build. Nothing out of the ordinary ... we're a mplayer game, though. Not sure if that makes a diff

  6. bueda

    Oct 19, 2016 10:20

    The issue occurs for me as well.
    I run Unity 5.5.0b2 on Linux, and the issue started appearing after upgrading my project to 5.5.0.b5 and subsequently downgrading back to 5.5.0b2 (as b5 had a couple of annoying bugs).

    I removed $project/Library (the Unity Editor cache directory), which was subsequently re-created on reopening the project, and the error is now gone.

    It seemed to have caused no issues except for the rather cryptic error messages.

  7. ScionOfDesign

    Oct 06, 2016 04:24

    I have the same issue. It doesn't seem to affect the build, but it is strange.

  8. FoxCastz

    Sep 29, 2016 23:05

    Is there a fix to this that doesn't require that I delete my entire library, thus starting my project over?..

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.