PlayEveryWare / eos_plugin_for_unity

Repository for PlayEveryWare's EOS Plugin for Unity, bringing the functionality of Epic Online Services to the Unity Game Engine.
https://eospluginforunity.playeveryware.com
MIT License
275 stars 52 forks source link

Error loading EOS lib on Mac #60

Closed Nakano37 closed 2 years ago

Nakano37 commented 2 years ago

After going through the setup steps and installing via upm, I get the following error trying to start in the editor, both in the Auth sample and in my project:

NullReferenceException: Object reference not set to an instance of an object
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton+<>c.<LoadDelegatesWithEOSBindingAPI>b__60_0 (DLLHandle handle, System.String functionName) (at Library/PackageCache/com.playeveryware.eos@b1c455b332/Runtime/EOSManager_DynamicLoading.cs:218)
Epic.OnlineServices.Bindings.Hook[TLibraryHandle] (TLibraryHandle libraryHandle, System.Func`3[T1,T2,TResult] getFunctionPointer) (at Library/PackageCache/com.playeveryware.eos@b1c455b332/Runtime/EOS_SDK/Generated/Bindings.cs:29)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.LoadDelegatesWithEOSBindingAPI () (at Library/PackageCache/com.playeveryware.eos@b1c455b332/Runtime/EOSManager_DynamicLoading.cs:217)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.LoadEOSLibraries () (at Library/PackageCache/com.playeveryware.eos@b1c455b332/Runtime/EOSManager_DynamicLoading.cs:341)
PlayEveryWare.EpicOnlineServices.EOSManager+EOSSingleton.Init (PlayEveryWare.EpicOnlineServices.IEOSCoroutineOwner coroutineOwner) (at Library/PackageCache/com.playeveryware.eos@b1c455b332/Runtime/EOSManager.cs:388)
PlayEveryWare.EpicOnlineServices.EOSManager.Awake () (at Library/PackageCache/com.playeveryware.eos@b1c455b332/Runtime/EOSManager.cs:1021)

It seems to be looking for libEOSSDK-Mac-Shipping, which I can't find anywhere in the project.

Nakano37 commented 2 years ago

I tried adding libEOSSDK-Mac-Shipping.dylib to the project from the C# sdk in the plugins directory but it still gives this error.

Nakano37 commented 2 years ago

The build also fails on OSX with the following error:

Library/PackageCache/com.playeveryware.eos@b1c455b332/Runtime/DLLHandle.cs(218,51): error CS1061: 'SystemDynamicLibrary' does not contain a definition for 'UnloadLibrary' and no accessible extension method 'UnloadLibrary' accepting a first argument of type 'SystemDynamicLibrary' could be found (are you missing a using directive or an assembly reference?)

ReleaseHandle on DLLHandler calls this method on non-UNITY_EDITOR builds

    protected override bool ReleaseHandle()
    {
        if(handle == IntPtr.Zero)
        {
            return true;
        }
        bool didUnload = true;
#if !UNITY_EDITOR
        didUnload = SystemDynamicLibrary.Instance.UnloadLibrary(handle);
        print("Unloading a Dll with result : " + didUnload);
#endif
        SetHandle(IntPtr.Zero);
        return didUnload;
    }

but the SystemDynamicLibrary doesn't define UnloadLibrary for UNITY_STANDALONE_OSX

#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN || UNITY_ANDROID || UNITY_IOS
    public bool UnloadLibrary(IntPtr libraryHandle)
    {
#if EOS_DISABLE
        return true;
#elif UNITY_EDITOR_WIN && !UNITY_ANDROID
        return FreeLibrary(libraryHandle);
#else
        return DLLH_unload_library_at_path(DLLHContex, libraryHandle);
#endif
    }
#endif
andrew-hirata-playeveryware commented 2 years ago

The Plugin doesn't currently support macOS yet though this is something we are targeting on supporting in the future.

domlaurenti commented 2 years ago

Going to close this issue as the Mac platform is not currently supported. Feel free to reopen the issue if it still occurs after official support has been provided.