Quickstart-unity: macOS standalone - "DllNotFoundException: App-4.5.0"

Created on 10 Apr 2018  路  12Comments  路  Source: firebase/quickstart-unity

Overview

When trying to run a macOS standalone build i get a runtime exception: "DllNotFoundException: App-4.5.0"

We are only using the realtime database features (NOT firestore).

Operating system: macOS High Sierra 10.13.4 (17E199)

What steps will reproduce the problem:

  1. Use Firebase Database on a macOS standalone build

What is the expected result?
I expect the database calls to go through

What happens instead of that?
I get an exception:
DllNotFoundException: App-4.5.0

More Info

Versions
Unity 2017.4.0f1
macOS High Sierra 10.13.4 (17E199)

Settings
Mono 2.0 (full)
.NET 3.5 equivalent
x64 build target

The docs claim this is a supported _beta_ feature

When you are creating an app, it's often much easier to test your app in the Unity editor and on desktop platforms first, then deploy and test on mobile devices later on in development. To support this workflow, we provide a subset of the Firebase Unity SDK which can run on Windows, OS X, Linux, and from within the Unity editor:

Here is the relevant run-time unity log.
firebase-macos-dllexception.log

It contains a log of duplicate lines like this:

Fallback handler could not load library /path/to/my/App.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0
bug

All 12 comments

I have same issue Firebase Database not working on Mac OS Standalone build.

I am having the same issue with running a standalone Android build.
android.log

Hi Pixelrella, if you observing this issue on Android build then the solution is simple. Just make sure you have clicked on resolve client jar files.
Assets -> Play Services Resolver -> Android Resolver -> Resolve

and then create the android build.

@Matthiax are you sure you have Plugins/x86_64/App-4.5.0.bundle in your project (it would have been included by any of the plugins). Since 4.5.0 we now version the App DLL / shared library such that you need the corresponding managed Firebase.*.dll paired with each versioned native App library component.

@stewartmiles I have the file. I believe they are:

Firebase/Plugins/Firebase.App.dll
Plugins/x86_64/Firebase/App-4.5.0.bundle
Plugins/x86_64/Firebase/App-4.5.0.so
Plugins/x86_64/Firebase/App-4.5.0.dll

@Matthiax I reproduced the issue on OSX, it's likely similar on other platforms as well. FYI posting your logs from https://docs.unity3d.com/Manual/LogFiles.html would have been handy ;) . In the Unity player logs on my machine I see:

Fallback handler could not load library /Users/smiles/dev/src/unity_test/analytics/client/unity/testapp/osx2.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.1 Fallback handler could not load library /Users/smiles/dev/src/unity_test/analytics/client/unity/testapp/osx2.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.1.dylib Fallback handler could not load library /Users/smiles/dev/src/unity_test/analytics/client/unity/testapp/osx2.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.1.so Fallback handler could not load library /Users/smiles/dev/src/unity_test/analytics/client/unity/testapp/osx2.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.1 Fallback handler could not load library /Users/smiles/dev/src/unity_test/analytics/client/unity/testapp/osx2.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.1.bundle Fallback handler could not load library /Users/smiles/dev/src/unity_test/analytics/client/unity/testapp/osx2.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.1.dylib Fallback handler could not load library /Users/smiles/dev/src/unity_test/analytics/client/unity/testapp/osx2.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.1.so

This looks like a similar bug to https://forum.unity.com/threads/dll-not-found-with-standalone-app-but-works-fine-in-editor.389392/ . Firebase's Unity SDK uses a C++ SDK baked into a shared library for the heavy lifting (Plugins/x86_64/App.{bundle,so.dll}). This shared library isn't being found in standalone builds as it looks like the Unity player is not setting up the correct search paths to search.

To work around this, you'll need to copy App-*.bundle from Contents/Plugins/x86_64/ to Contents/Frameworks/MonoEmbedRuntime/.

We're looking into other options but it's likely we'll need to add a post build step using PostProcessBuildAttribute in our editor plugin to resolve this.

@stewartmiles Thanks for the reply! I included a snippet of my log as a downloadable file in my original post.

I tried the work around you suggested, but I'm getting the same issues. I've tried several combinations, and i still get errors. The folder structure I ended up with (that, to me, seems like it would solve every permutation of this problem) looks like this:

screenshot 2018-04-19 10 41 39

Here is the log I'm seeing now (it looks identical to me)

Initialize engine version: 2017.4.0f1 (b5bd171ee9ba)
GfxDevice: creating device client; threaded=1
2018-04-19 10:35:40.028 DangerRoom-macOS[2624:91926] LG UltraFine preferred device: AMD Radeon Pro 460 (high power)
2018-04-19 10:35:40.029 DangerRoom-macOS[2624:91926] Metal devices available: 2
2018-04-19 10:35:40.029 DangerRoom-macOS[2624:91926] 0: Intel(R) HD Graphics 530 (low power)
2018-04-19 10:35:40.029 DangerRoom-macOS[2624:91926] 1: AMD Radeon Pro 460 (high power)
2018-04-19 10:35:40.029 DangerRoom-macOS[2624:91926] Using device AMD Radeon Pro 460 (high power)
Initializing Metal device caps: AMD Radeon Pro 460
Begin MonoManager ReloadAssembly
- Completed reload, in  0.061 seconds
WARNING: Shader Unsupported: 'Hidden/VideoDecodeOSX' - Pass 'FLIP_RGBARECT_TO_RGBA' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/VideoDecodeOSX' - Setting to default shader.
WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default shader.
WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.
Metal RecreateSurface[0x10948fc50]: surface size 1600x1200
Setting up 4 worker threads for Enlighten.
  Thread -> id: 700004552000 -> priority: 1 
  Thread -> id: 7000045d5000 -> priority: 1 
  Thread -> id: 700004658000 -> priority: 1 
  Thread -> id: 7000046db000 -> priority: 1 
UnloadTime: 2.019181 ms

Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./App-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/App-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.dylib
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.so
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/./libApp-4.5.0.bundle
Fallback handler could not load library /Path/To/app.app/Contents/Frameworks/MonoEmbedRuntime/osx/libApp-4.5.0
DllNotFoundException: App-4.5.0
  at (wrapper managed-to-native) Firebase.AppUtilPINVOKE/SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_AppUtil (Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
  at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x00000] in <filename unknown>:0 
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for SWIGExceptionHelper
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <filename unknown>:0 
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Firebase.AppUtilPINVOKE
  at Firebase.FirebaseApp.get_DefaultName () [0x00000] in <filename unknown>:0 
  at Firebase.FirebaseApp.get_DefaultInstance () [0x00000] in <filename unknown>:0 
  at FirebaseManager.Awake () [0x0000d] in /Path/To/Project/Assets/Scripts/Managers/FirebaseManager.cs:41 

@Matthiax as described by the log you need to move App-*.bundle into:

  • app.app/Contents/Frameworks/MonoEmbedRuntime/osx/

You moved the libraries into:

  • app.app/Contents/Frameworks/Mono/MonoEmbedRuntime/osx/

We're experiencing the same issue as well, and copying libraries doesn't seem to have the same effect, especially as some of the files that are not being found are not in the Contents/Plugins/x86_64

@stewartmiles we also confirmed that the files we copied were copied into:

app.app/Contents/Frameworks/MonoEmbedRuntime/osx/

@monoclesociety
In additional to copy .bundle to Contents/Frameworks/MonoEmbedRuntime/osx/, you also need to rename them with "lib" prefix, ex. App-4.5.0.bundle to libApp-4.5.0.bundle.

we are working on an automatic process to do so. At the meantime, you may need to manually do this every time after build.

Yep @chkuang-g 's suggestion does get the standalone build running. However it would be a pain to have to do that everytime. I use the standalone OSX build for easy multiplayer testing. Does anyone know what version this bug appeared in? I'm considering rolling back

Edit: Ah never mind I see thats its actually Unity's fault. Sorry!

In case anyone needs it, here is a script I wrote that gets the OSX build working:

using System;
using System.IO;
using System.Text;

using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;

public class OSXStandaloneFirebasePostProcess : MonoBehaviour
{
    [PostProcessBuildAttribute(1)]
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
    {
        if (target != BuildTarget.StandaloneOSX) {
            return;
        }
        Debug.Log("OSX Standalone Script. Executing post process build phase to fix Firebase dependencies.");
        Debug.Log("Path to XCode project: " + pathToBuiltProject);

        // Build paths
        var frameworksPath = Path.Combine(pathToBuiltProject, "Contents/Frameworks/MonoEmbedRuntime/osx");
        var modulesPath = Path.Combine(Application.dataPath, "Plugins/x86_64/Firebase");
        var streamingAssetsPath = Path.Combine(pathToBuiltProject, "Contents/StreamingAssets");

        // Create MonoEmbedRuntime folder inside Frameworks folder of standalone
        Directory.CreateDirectory(frameworksPath);
        Directory.CreateDirectory(streamingAssetsPath);

        // Copy all *.bundle files from Plugins/x86_64/Firebase to MonoEmbedRuntime/lib*.bundle
        string[] bundleFiles = Directory.GetFiles(modulesPath, "*.bundle");
        foreach (string bundleFile in bundleFiles) {
            string bundleFileName = Path.GetFileName(bundleFile);
            FileUtil.CopyFileOrDirectory(Path.Combine(modulesPath, bundleFileName), Path.Combine(frameworksPath, "lib" + bundleFileName));
        }

        // Copy StreamingAssets/google-services-desktop.json
        FileUtil.CopyFileOrDirectory(Path.Combine(Application.dataPath, "StreamingAssets/google-services-desktop.json"), Path.Combine(streamingAssetsPath, "google-services-desktop.json"));

        Debug.Log("OSX Standalone Script. Finished executing post process build phase to fix Firebase dependencies.");
    }
}

Hi everyone, we have fixed this in version 5.0.0 https://firebase.google.com/support/release-notes/unity#5.0.0

Was this page helpful?
0 / 5 - 0 ratings