Skip to content

IL2CPP in build error - Delegate to an instance method cannot have null 'this'. #150

@Ko0z

Description

@Ko0z

After installing a fresh 2020 LTS editor with IL2CPP support, empty scene with FishNet NetworkManager and Player prefab. Apparently if any NetworkBehaviour has a [ServerRpc] method it will throw and error when starting Server and Client in a build.

Error if any NetworkBehaviour has a [ServerRpc] of any kind.
"Delegate to an instance method cannot have null 'this'."

The error is NOT present in Unity 2020.3.18f1.

Steps to reproduce:

  1. Install fresh unity 2020.3.41f1 LTS version with IL2CPP support for windows.
  2. Create a new project, set scripting backend to IL2CPP with .NET 4.x API and import FishNet v2.5.10.
  3. Use the FishNet NetworkManager prefab and put the FIshNet Player prebab in the PlayerSpawner.
  4. Build the project with Development Build to see log and watch the error happen when starting server and then client.

FishNet_error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Third-Party Bug or LimitationIssue is a bug or limitation wiithin Unity or a third-party asset.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions