Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP: (0,0): error

Discussion in 'Netcode for GameObjects' started by greasybuild, Nov 21, 2023.

  1. greasybuild

    greasybuild

    Joined:
    Dec 17, 2022
    Posts:
    1
    Just updated Unity from LTS 2022.3.4f1 to LTS 2022.3.13f1 and I believe it also up updated Netcode from 1.6.1(?) to 1.7.0.

    Now all the sudden getting an error I didn't have before and I can't figure it out. I've seen some discussion on deleting NetworkBehaviour scripts and recreating them to resolve the error but there are quite a few and don't want to have to deal with this headache. Anyone know of any other fixes or have any suggestions?

    Error:
    • Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP: (0,0): error - System.ArgumentNullException: Value cannot be null. (Parameter 'method')|| at Mono.Cecil.Cil.Instruction.Create(OpCode opcode, MethodReference method)|| at
    • Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.ProcessNetworkBehaviour(TypeDefinition typeDefinition, String[] assemblyDefines)|| at System.Collections.Generic.List`1.ForEach(Action`1 action)|| at
    • Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.Process(ICompiledAssembly compiledAssembly) at Mono.Cecil.Cil.Instruction.Create(OpCode opcode, MethodReference method)|| at
    • Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.ProcessNetworkBehaviour(TypeDefinition typeDefinition, String[] assemblyDefines)|| at System.Collections.Generic.List`1.ForEach(Action`1 action)|| at
    • Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP.Process(ICompiledAssembly compiledAssembly)
     
    Last edited: Nov 21, 2023
  2. edwardxperia2000

    edwardxperia2000

    Joined:
    Oct 16, 2022
    Posts:
    2
    I have the same error! It occurs if any RPC function exists in a class that inherits from a class with NetworkBehaviour upload_2023-11-23_4-0-53.png
    and BaseCounter:
    upload_2023-11-23_4-1-23.png

    If I remove the client and server RPC function from here, the error in my project disappears. I don't know how to fix it yet.
     

    Attached Files:

  3. edwardxperia2000

    edwardxperia2000

    Joined:
    Oct 16, 2022
    Posts:
    2
  4. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    437
    Hi @edwardxperia2000 , this does sound like a recent regression bug that will be fixed in a future NGO update (hopefully v1.7.1).

    The bug is that If you have multi-generation derived children of NetworkBehaviour where:
    • 2nd Generation Child: Has one or more ClientRpc or ServerRpc attribute decorated methods
    • 1st Generation Child: Has no ClientRpc or ServerRpc attribute decorated methods
    • Parent - NetworkBehaviour
    This can result in an ILPP error that looks like the one you posted.

    There are two ways to resolve this issue prior to the v1.7.1 NGO package update:

    Option-1:
    Create place-holder Rpc

    The bug encountered has an issue with a "middle generation" class not having any ClientRpc or ServerRpc attribute decorated methods. By adding a temporary Rpc (either ClientRpc or ServerRpc) to the 1st Generation Child (referencing the above example) it should resolve the issue.

    When the user updates to NGO v1.7.1, they can remove the place-holder Rpc method(s).

    Option-2:
    Temporarily Point Manifest to the release/1.7.1 branch
    Replace your com.unity.netcode.gameobjects entry in Packages\manifest.json file with this:

    Code (CSharp):
    1. "com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#release/1.7.1",
    That branch includes the fix for that particular issue.

    Does this help?
     
  5. ANLevant

    ANLevant

    Joined:
    Jun 10, 2014
    Posts:
    21
    This totally solved the issue for me. Thumbs up sir!
     
    RikuTheFuffs-U and RikuTheFuffs like this.
  6. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    437
    Great! @ANLevant 1.7.1 was released today by the way, so you can update to it directly without referencing branches around
     
    Angagsu-1, JayHuangYC and ANLevant like this.
  7. TheUsualGuy

    TheUsualGuy

    Joined:
    Nov 10, 2021
    Posts:
    1
    Solved by updating to newer version (1.7.1 in my case)
     
    ANLevant likes this.
  8. munkiki7

    munkiki7

    Joined:
    Jul 10, 2018
    Posts:
    3
    Same here.