Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Build failed for MacOS version of Unity Project with GOG SDK

Discussion in 'Editor & General Support' started by Phan-Phantz, Sep 12, 2022.

  1. Phan-Phantz

    Phan-Phantz

    Joined:
    Nov 11, 2015
    Posts:
    17
    1) We tried to build MacOS version of our Unity Game with GOG SDK Version : 1.144.1
    and the build failed with error in Unity 2021.3.2f1, 2021.3.8f1, and 2022.20b6 on MacOS Monterey 12.3.1 :

    Building /Users/<BuildFolder>/<OurGame>.app/Contents/PlugIns/Galaxy.bundle/Contents/MacOS/libGalaxyCSharpGlue.dylib failed with output:

    Failed because this command failed to write the following output files: /Users/<BuildFolder>/<OurGame>.app/Contents/PlugIns/Galaxy.bundle/Contents/_CodeSignature/CodeResources

    This is from the Editor log :

    System.Exception: Could not find executable at '/Users/<BuildFolder>/<OurGame>.app/Contents/PlugIns/Galaxy.bundle/Contents/MacOS/Galaxy' inside a bundle.


    From a Editor log message above, it shows that Unity could not find executable at <OurGame>.app/Contents/PlugIns/Galaxy.bundle/Contents/MacOS/Galaxy

    2) From previous errors, we got a workaround to build the game by renaming ‘libGalaxy.dylib’ and ‘libGalaxyCSharpGlue.dylib’ to ‘Galaxy’ and ‘GalaxyCSharpGlue’ with no extensions and can build successfully but then when we run the game, it produces this error log :

    DllNotFoundException: Unable to load DLL 'GalaxyCSharpGlue'. Tried the load the following dynamic libraries: Unable to load dynamic library 'GalaxyCSharpGlue' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen(GalaxyCSharpGlue, 0x0005): tried: 'GalaxyCSharpGlue' (no such file), '/usr/local/lib/GalaxyCSharpGlue' (no such file), '/usr/lib/GalaxyCSharpGlue' (no such file), '/Users/<BuildFolder>/GalaxyCSharpGlue' (no such file)

    3) It appears that ‘GalaxyCSharpGlue' needs to be in the directory that contains our game’s .app file. So, we tried moving GalaxyCSharpGlue to that directory then we encountered a different error:

    DllNotFoundException: Unable to load DLL 'GalaxyCSharpGlue'. Tried the load the following dynamic libraries: Unable to load dynamic library 'GalaxyCSharpGlue' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen(GalaxyCSharpGlue, 0x0005): tried: 'GalaxyCSharpGlue' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/GalaxyCSharpGlue' (no such file), '/usr/lib/GalaxyCSharpGlue' (no such file), '/Users/<BuildFolder>/GalaxyCSharpGlue' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

    4) We tried renaming 'GalaxyCSharpGlue' back to 'GalaxyCSharpGlue.bundle' , 'GalaxyCSharpGlue,dylib', and ‘ 'libGalaxyCSharpGlue.dylib' but nothing work.
     
  2. kloot

    kloot

    Joined:
    Mar 14, 2018
    Posts:
    78
    I'm struggling with the same thing, did you ever found a solution?
     
  3. kloot

    kloot

    Joined:
    Mar 14, 2018
    Posts:
    78
    Found the solution:
    For some reason, Unity won't include the files in the build. But all you need to do is to copy the two dylib files mentioned above into the /Content/Plugins folder after the build is finished
     
  4. Cypers

    Cypers

    Joined:
    Dec 8, 2022
    Posts:
    1
    Hey,

    Cyprian from GOG Dev Support here!
    If you experience any issues with implementing GOG SDK in your game, please don't hesitate to contact us :)

    You can contact Dev Support via devportal, simply open devportal, select: Support - > Contact Support(email) or Submit a ticket.

    We would appreciate if you could cram as much info as possible in your request(including screenshots and such) :)
     
  5. kloot

    kloot

    Joined:
    Mar 14, 2018
    Posts:
    78
    Hi, GOG Dev Support
    As you can tell, the binaries from your SDK are copied correctly during build for Windows and Linux, but not for Mac. This is happening since (at least) Unity 2021 LTS.
     
  6. RambosRide

    RambosRide

    Joined:
    Nov 8, 2020
    Posts:
    37
    I can concur this - unity build does not copy correct binaries on MacOS build
     
    kloot likes this.
  7. BoaNeo

    BoaNeo

    Joined:
    Feb 21, 2013
    Posts:
    56
    I managed to convince it by changing the CPU settings from "Intel" to "AnyCPU"... I'm on an Intel Mac so it does not make a lot of sense, but those platform filters have always been a bit wonky.