Skip to content

[Unity 4.6.9p4] Error building player because script class layout is incompatible between the editor and the player. #21

@LoganBooker

Description

@LoganBooker

Hello veblush, thanks for your hard work with the incremental compiler. Has probably saved me hours already in wait times!

I wanted to bring to your attention a possible issue with the compiler: it doesn't seem to play nice when creating standalone builds. In my case a typical 32-bit Windows one, but this could be an issue for all platforms.

So you know, we're still running 4.6.9p4. Upgrading to 5.x is not an option -- we have a large tech base on this version, including a significant rewrite of Unity 4's rendering pipeline. It's possible this issue doesn't appear in 5.x, but I haven't tested as such.

Basically, all you have to do is try and create a standalone build. After a second or two you'll see this error:

Error building player because script class layout is incompatible between the editor and the player.

Restarting Unity, rebuilding the library, recompiling again, etc. has no effect. The error continues to appear.

A workaround is possible via the following steps:

  1. Go to Assets -> Open C# Compiler Settings...
  2. Change "Compiler" from "Incremental 6" to "Mono 6".
  3. Attempt to build the project, which will fail with the following error:

Internal compiler error. See the console log for more information. output was:Compiler redirection error: System.NullReferenceException
Object reference not set to an instance of an object at Program.Compile (System.String[] args, .Logger logger, .Settings settings) [0x00000] in :0
at Program.Main (System.String[] args) [0x00000] in :0

  1. After the build fails, go back to the compiler settings and change it back to "Incremental 6".
  2. Build the project again. This time it will succeed.

I'm not entirely sure why this works, but my theory is switching the compiler clears out the old data being held by the compile server. However, killing / restarting the server doesn't have the same effect as the switch does, so I'm not sure if this is the case.

Please let me know if you need more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions