Search Unity

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

Resolved Unity Multiplay won't create iOS build due to namespace errors

Discussion in 'Multiplayer' started by JohnWords, Aug 25, 2023.

  1. JohnWords

    JohnWords

    Joined:
    Jul 30, 2023
    Posts:
    1
    I've built a small project off the github matchplay example, but can't build that example to ios.

    Running in editor on platform ios and everything is fine, but if I try to create a build for export I get namespace errors, e.g. "The type or namespace 'MultiplayEventCallbacks' could not be found"
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,108
    I think Multiplay is an editor-only namespace. Check where this is used and make sure it does not compile in builds, eg #if UNITY_EDITOR or move script to Editor folder (or asmdef).
     
  3. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    416
    To be more precise, Multiplay is only supported for the main desktop/server platforms (Windows, Mac, Linux). You generally only want to call into the Multiplay SDK from your server build. Client builds shouldn't include the SDK. You can use assembly definitions to constrain your Multiplay-using code to only some platforms or builds.