UnityStandaloneFileBrowser: DLL not found issue in Mac build
Getting this error in my MacOS mono build;
DllNotFoundException: StandaloneFileBrowser SFB.StandaloneFileBrowserMac.OpenFilePanel (System.String title, System.String directory, SFB.ExtensionFilter[] extensions, System.Boolean multiselect) (at Assets/StandaloneFileBrowser/StandaloneFileBrowserMac.cs:44) SFB.StandaloneFileBrowser.OpenFilePanel (System.String title, System.String directory, SFB.ExtensionFilter[] extensions, System.Boolean multiselect) (at Assets/StandaloneFileBrowser/StandaloneFileBrowser.cs:51) SFB.StandaloneFileBrowser.OpenFilePanel (System.String title, System.String directory, System.String extension, System.Boolean multiselect) (at Assets/StandaloneFileBrowser/StandaloneFileBrowser.cs:39) CanvasSampleOpenFileImage.OnClick () (at Assets/StandaloneFileBrowser/Sample/CanvasSampleOpenFileImage.cs:41) UnityEngine.Events.InvokableCall.Invoke () (at /Users/bokken/buildslave/unity/build/Runtime/Export/UnityEvent/UnityEvent.cs:166) UnityEngine.Events.UnityEvent.Invoke () (at /Users/bokken/buildslave/unity/build/Runtime/Export/UnityEvent/UnityEvent/UnityEvent_0.cs:58) UnityEngine.UI.Button.Press () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Button.cs:68) UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Button.cs:110) UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:50) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:261) UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:377)
How can I fix this? Thanks!
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 25
Commits related to this issue
- Fix for #109 — committed to davidmfinol/UnityStandaloneFileBrowser by davidmfinol 2 years ago
- Made suggested changes https://github.com/gkngkc/UnityStandaloneFileBrowser/issues/109#issuecomment-914488120 — committed to gkatsaros-endlessstudios/UnityStandaloneFileBrowser by gkatsaros-endlessstudios a year ago
Sure! Here is the plugin with the added compatibility:
UnityStandaloneFileBrowser_arm64.zip
Unfortunately, some bugs still persist as mentioned by @hippogamesunity, but in any case, with this upgrade the system file browser is correctly loaded in macos. Therefore, in my opinion, this free plugin remains a valid alternative to other paid plugins.
We need a true mac dev as there is source code available) I’m not, unfortunately.
I solved this by building a universal bundle. To do this, I opened the StandaloneFileBrowser.xcodeproj/project.pbxproj and modified
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";toARCHS = "$(ARCHS_STANDARD)";and I removed
VALID_ARCHS = x86_64;which when set made the .bundle created not include the arm64 slice.Finally I confirmed with
lipo -info StandaloneFileBrowseroutputx86_64 arm64and replaced it into the unity project.This project is abandoned. The asset has a few critical bugs on Mac, like app crashes when you press Cancel in File Picker. I’ve purchased another asset and it works fine https://assetstore.unity.com/packages/tools/utilities/file-browser-pro-98713
@acgourley thank you so much!! Now work in mac m2 pro!!
If anyone need it, these are the precise steps I followed:
If you had already uploaded the asset to unity, make sure you re-import it after replacing the bundle file, before continuing with the project
I’m not sure if we can include both original and fixed bundles.
Tested x64 architecture only + Core i5, it doesn’t work (missed DLL).
Ah typo in that filename, it’s this one: https://github.com/gkngkc/UnityStandaloneFileBrowser/blob/master/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.pbxproj
In my case, Build Settings>PC, Mac & Linux Standalone > Architecture > “Intel 64-bit” works fine in my M1 mac and my old i-mac using Unity 2020.3.9f1.
Unfortunately I get same error messages setting “Apple silicon” or “Intel 64-bit + Apple silicon”. Even though I rebuilt StandaloneFileBrowser.bundle on Xcode of M1 mac, I cannot fix this issue now.