These are the docs for 11.0, an old version of SpatialOS. The docs for this version are frozen: we do not correct, update or republish them. 14.5 is the newest →

This page applies to SpatialOS 10.4. It hasn’t been upgraded to SpatialOS 11 yet.

Troubleshooting Unity iOS support

The following accompanying errors are also seen.

"No member named '__OrConstraint_4' in 'Union_t434886010'"

"Use of undeclared identifier '__OrConstraint4'; did you mean '__AndConstraint3'?"

The semantic issues and build errors that you see are due to a known issue with Unity’s IL2CPP scripting backend, which generates the relevant source code and header files used in Xcode. Specifically, when generating code from our included library Improbable.WorkerSdkCsharp.dll, a cyclic dependency between 3 header files causes this error.

Note: To fix these errors automatically, you may use this script, which performs the steps outlined below automatically. You should use this script when you are ready to build and run your Xcode project.

  1. Place it in the workers/unity/ folder of your project.
  2. The scripts assumes that your Xcode project resides in workers/unity/build/UnityClient@iOS/UnityClient@iOS/Unity-iPhone.xcodeproj.
  3. Run the script by performing sh from the terminal.
  4. Compiling the project within Xcode should complete successfully now.

To fix these errors manually, you will need perform the following steps:

  1. Click on any of the errors in Xcode, this should bring up the offending file in the main window.
    • The file will be named and located along the lines of UnityClient@iOS/Classes/Native/Improbable_WorkerSdkCsharp_Improbable_Worker_Intern434886010.h
    • It will containing the struct definition of Improbable.Worker.Internal.WorkerProtocol/Constraint/Union.
  2. Locate the line containing the error related to OrConstraint_t167232821.
  3. Navigate to the file containing the definition of the struct, either by right-clicking (or CTRL+click) and selecting Jump to definition. Alternatively, you can hold CMD on the keyboard and click on the the type name itself.

    Jump to definition of error

  4. The opened file will contain the struct definition of Improbable.Worker.Internal.WorkerProtocol/OrConstraint.

  5. Add a single set of include guards around the definition of all the structs in the file.

    • This is accomplished by adding #ifndefand #define before the the struct definition, followed by an #endif at the end of the file.
    • Your final file should look something like the following.

      // The rest of the file contents here remains the same.
      #ifndef __io_orconstraint__
      #define __io_orconstraint__
      struct  OrConstraint_t1672328221
      // The rest of the file contents here remains the same.
      struct OrConstraint_t1672328221_marshaled_com
      uint32_t ___ConstraintCount_0;
      Constraint_t789865754 * ___Constraint_1;
  6. Copy the contents of this file, beginning from the line of your newly inserted include guard (e.g., #ifndef __io_orconstraint__) until the end of the file.

  7. Return to the offending file, which you first identified in Step 1.

  8. Paste the copied contents above the line containing the comment // Improbable.Worker.Internal.WorkerProtocol/Constraint/Union and the opening definition of the Union struct.

  9. Repeat steps 3–8, but this time for the AndConstraint_t2034325175.

    Make sure to use a different name for the include guards, e.g., #ifndef __io_andconstraint and #define __io_andconstraint__.

  10. The project should compile without errors now.

The following accompanying output is also seen.

ld: warning: directory not found for option '-L"<path_to_unity_worker>/build/UnityClient@iOS/UnityClient@iOS/Libraries"'
ld: library not found for -liPhone-lib
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is an issue with how Unity sets the Library Search Path in Xcode settings; it appears after a user manually adds an external library (for example, libCoreSdkDll.dylib) to an existing Xcode project built out from Unity. The following steps will resolve the issue.

  1. In the Project Navigator located on the left panel of Xcode, click on Unity-iPhone:

    Player Settings: Other Settings Example

  2. On the main pane of Xcode, click on Unity-iPhone listed under Targets (not Project!)

    Player Settings: Other Settings Example

  3. Click on the Build Settings tab.

    Player Settings: Other Settings Example

  4. In Search Paths -> Library Search Paths, remove all double quotes from the entries listed there.

    For example, "$(SRCROOT)/Libraries" should be just $(SRCROOT)/Libraries

In Xcode, on running my application, I am seeing dyld: Library not loaded: @rpath/libCoreSdkDll.dylib

  • Check that you have remembered to perform the code-signing of your libCoreSdkDll.dylib.
  • Check that you have used the correct menu item to perform the code-signing of your libCoreSdkDll.dylib.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums