Can't build Unity macOS with SDK 5.4.2

228 views
Skip to first unread message

Mike Perry

unread,
Nov 17, 2018, 12:27:34 AM11/17/18
to Firebase Google Group
I'm seeing a couple of issues building to macOS using the Firebase Unity SDK v5.4.2 in Unity 2018.2.14f1. Have I missed a config setting or dependency update somewhere?

The first issue is that the bundles in Plugins/x86_64/Firebase are not enabled for Mac OS X. In the previous SDK I was using (5.2.1), Mac OS X was checked.

Unity_2018_2_14f1__64bit__.png

Without this, Firebase is not included in the projected, and the files are missing from the *.app/Contents/Plugins directory. If I manually enable each bundle for Mac OS X, the libraries will appear in the root of the *.app/Contents/Plugins directory.


However, the second issue is that the build still fails, with an error after the following output in the console:


Post process to patch App.bundle's location
UnityEngine.Debug:Log(Object)
Firebase.Editor.DllLocationPatcher:CopyLibrary(String, String, String, String) (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/DllLocationPatcher.cs:71)
Firebase.Editor.DllLocationPatcher:OnPostProcessDllLocation(BuildTarget, String) (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/DllLocationPatcher.cs:53)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()


DirectoryNotFoundException: Directory '/Users/mikep/src/xxxxxx/Builds/macOS/xxxxxx.app/Contents/Plugins/x86_64' not found.
System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:514)
System.IO.Directory.GetFiles (System.String path, System.String searchPattern) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:308)
Firebase.Editor.DllLocationPatcher.CopyLibrary (System.String srcFolder, System.String dstFolder, System.String prefix, System.String extension) (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/DllLocationPatcher.cs:74)
Firebase.Editor.DllLocationPatcher.OnPostProcessDllLocation (BuildTarget buildTarget, System.String pathToBuiltProject) (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/DllLocationPatcher.cs:53)


The Contents/Plugins/x86_64 directory does not exist in the build, and this process is failing. This error did not occur with SDK 5.2.1.


In 5.2.1, the libraries end up Contents/Plugins/x86_64. In 5.4.2, the libraries don't make it into the build unless I manually enable Mac OS X, and after that, they end up in the root of Contents/Plugins, with the x86_64 directory missing.


Thanks

-Mike


Stewart Miles

unread,
Nov 19, 2018, 7:43:59 PM11/19/18
to fireba...@googlegroups.com
Thanks for the report Mike.  This looks like a bug in our packaging tool, it looks like the .bundle.meta files have:

  platformData:
  - first:
      '': OSXIntel
    second:
      enabled: 0
      settings:
        CPU: None
  - first:
      '': OSXIntel64
    second:
      enabled: 1
      settings:
        CPU: AnyCPU
  - first:
      Standalone: OSXUniversal
    second:
      enabled: 0
      settings:
        CPU: None

rather than:

  platformData:
  - first:
      '': OSXIntel
    second:
      enabled: 0
      settings:
        CPU: None
  - first:
      '': OSXIntel64
    second:
      enabled: 1
      settings:
        CPU: AnyCPU
  - first:
      Standalone: OSXUniversal
    second:
      enabled: 1
      settings:
        CPU: AnyCPU

Without OSXUniversal set to 1, Unity doesn't include the libraries in the OSX build.  Which TBH is pretty strange since they're clearly not universal (i.e far libraries with x86 and x86_64 binaries) if we only have the x86_64 build target enabled.  I think the behavior changed when Unity removed 32-bit OSX support.

When I build an application with "Mac OSX: x84" enabled for each Firebase bundle, I end up with everything being placed under mac.app/Contents/Plugins which appears to work fine when launching the application.  For example, with authentication:


To confirm, are you saying things are fine if you enable the bundles (shared libraries) for Mac OSX? 

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/74bae2f3-c2f0-4328-83cc-2f417c41712a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Perry

unread,
Nov 19, 2018, 10:46:02 PM11/19/18
to Firebase Google Group
Thanks Stewart. Yes, if I enable Mac OSX x64 for each Firebase bundle, my app does appear to work fine, with the bundles and libraries (*.so) ending up in Contents/Plugins.

However, Unity still reports a build failure with the post process error I noted above. Do you see that error too? Or is is just on my end? My guess is that DllLocationPatcher.cs is assuming the libraries are in (or need to be in) Contents/Plugins/x86_64. I'm not sure how to work around this.

(Side note: the Unity OSXUniversal setting is indeed odd. On Unity Cloud Build, it is now the only supported Mac build option, even though it appears to only build x86_64.)

Thanks!
-Mike
Reply all
Reply to author
Forward
0 new messages