Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DLL not found issue in Mac build #109

Open
aadhilkhan opened this issue Jul 22, 2021 · 25 comments
Open

DLL not found issue in Mac build #109

aadhilkhan opened this issue Jul 22, 2021 · 25 comments

Comments

@aadhilkhan
Copy link

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!

@YoshitakaAtarashi
Copy link

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.

@krys64
Copy link

krys64 commented Jul 29, 2021

Same error here, only intel 64-bit works

@hippogamesunity
Copy link

The same here with Mac M1 =(

@hippogamesunity
Copy link

@gkngkc hi! btw do you still support this project or it's abandoned?

@acgourley
Copy link

Same issue here, a pure intel64 build works but if it's built for silicon and intel64 the runtime will not find the dll.

@acgourley
Copy link

acgourley commented Sep 7, 2021

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)";
to
ARCHS = "$(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 StandaloneFileBrowser output x86_64 arm64 and replaced it into the unity project.

@davidmfinol
Copy link

davidmfinol commented Oct 29, 2021

I solved this by building a universal bundle. To do this, I opened the StandaloneFileBrowser.xcproject and modified

@acgourley

Where is this StandaloneFileBrowser.xcproject file? I'm not finding this file name in this repo.

EDIT: I take it that all we need is an updated version of the .bundle? Is there any way you could share the .bundle that you built?

@acgourley
Copy link

acgourley commented Oct 29, 2021

Ah typo in that filename, it's this one: https://github.com/gkngkc/UnityStandaloneFileBrowser/blob/master/Plugins/MacOS/StandaloneFileBrowser/StandaloneFileBrowser.xcodeproj/project.pbxproj

@davidmfinol
Copy link

Thank you, I got it working!

@hippogamesunity
Copy link

@davidmfinol Hello! Can you share your updated bundle please?

@davidmfinol
Copy link

@davidmfinol Hello! Can you share your updated bundle please?

Sure, you can find the bundle I created here: https://github.com/finol-digital/Card-Game-Simulator/tree/develop/Assets%2FStandaloneFileBrowser%2FPlugins%2FStandaloneFileBrowser.bundle

@hippogamesunity
Copy link

hippogamesunity commented Nov 9, 2021

@davidmfinol Many thanks! I was able to make it work. One thing you should note that we need to select StandaloneFileBrowser.bundle and choose 'Any CPU' option (it looks like it's set to 'Intel 64-bit' in your project).

@hippogamesunity
Copy link

@davidmfinol btw did you manage to also fix this issue?
#101

@davidmfinol
Copy link

@hippogamesunity
Thanks for pointing out the cpu option!
As for the other issue, I don't know if I "fixed" it, but at least I don't seem to be having that issue with my project.

davidmfinol added a commit to davidmfinol/UnityStandaloneFileBrowser that referenced this issue Apr 27, 2022
@JudahMantell
Copy link

For posterity's sake, here's the current link to @davidmfinol 's repo that has the functioning bundle file.
I just replaced the current .bundle file with this one and it works great on my M1 MacBook Air.

https://github.com/finol-digital/Card-Game-Simulator/tree/19305ce9cabf952ef1701144e2999eb0e53bfbe0/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle

Thanks!

@hippogamesunity
Copy link

@SceneForgeStudio Hi! I can confirm this works on M1 if built x64/silicon, but doesn't work on an old Mac with Core i5.

@JudahMantell
Copy link

@SceneForgeStudio Hi! I can confirm this works on M1 if built x64/silicon, but doesn't work on an old Mac with Core i5.

Interesting, so if I build just for regular x64/Intel then it won't work, only if it's a universal build?
I haven't tested an Intel-Only build, as I only need to publish for M1 (and universal during my app's beta period).

@hippogamesunity
Copy link

hippogamesunity commented Jun 11, 2022

Tested x64 architecture only + Core i5, it doesn't work (missed DLL).

@JudahMantell
Copy link

In that case you'll have to use the older non-M1 dll. You can probably use both and just change which CPU each one is for in the inspector.

@hippogamesunity
Copy link

I'm not sure if we can include both original and fixed bundles.

@hippogamesunity
Copy link

We need a true mac dev as there is source code available) I'm not, unfortunately.

@miche9
Copy link

miche9 commented Mar 21, 2023

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)"; to ARCHS = "$(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 StandaloneFileBrowser output x86_64 arm64 and replaced it into the unity project.

@acgourley thank you so much!!
Now work in mac m2 pro!!

If anyone need it, these are the precise steps I followed:

  1. In the UnityStandaloneFileBrowser folder, go to Plugin -> MacOS -> StandaloneFileBrowser
  2. Show package contents of StandaloneFileBrowser.xcodeproj
  3. Open the project.pbxproj file with Xcode
  4. Change the line ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; to ARCHS = "$(ARCHS_STANDARD)";
  5. Remove the line VALID_ARCHS = x86_64;
  6. Save the file and close Xcode
  7. Go back to the Plugin -> MacOS -> StandaloneFileBrowser folder
  8. Open StandaloneFileBrowser.xcodeproj with Xcode
  9. Perform the build. A StandaloneFileBrowser.bundle file will be created
  10. Go to the folder where the file was just created (you can find it in Xcode by going to Product -> show build folder in finder)
  11. Copy the StandaloneFileBrowser.bundle file
  12. Replace the existing file in the /StandaloneFileBrowser/Plugins/folder

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

@hippogamesunity
Copy link

hippogamesunity commented Mar 21, 2023

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

@JudahMantell
Copy link

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)"; to ARCHS = "$(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 StandaloneFileBrowser output x86_64 arm64 and replaced it into the unity project.

@acgourley thank you so much!! Now work in mac m2 pro!!

If anyone need it, these are the precise steps I followed:

  1. In the UnityStandaloneFileBrowser folder, go to Plugin -> MacOS -> StandaloneFileBrowser
  2. Show package contents of StandaloneFileBrowser.xcodeproj
  3. Open the project.pbxproj file with Xcode
  4. Change the line ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; to ARCHS = "$(ARCHS_STANDARD)";
  5. Remove the line VALID_ARCHS = x86_64;
  6. Save the file and close Xcode
  7. Go back to the Plugin -> MacOS -> StandaloneFileBrowser folder
  8. Open StandaloneFileBrowser.xcodeproj with Xcode
  9. Perform the build. A StandaloneFileBrowser.bundle file will be created
  10. Go to the folder where the file was just created (you can find it in Xcode by going to Product -> show build folder in finder)
  11. Copy the StandaloneFileBrowser.bundle file
  12. Replace the existing file in the /StandaloneFileBrowser/Plugins/folder

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

Would you be able to upload/send your latest bundle file for us to use? It would be super helpful.
Thanks!

@miche9
Copy link

miche9 commented Mar 27, 2023

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)"; to ARCHS = "$(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 StandaloneFileBrowser output x86_64 arm64 and replaced it into the unity project.

@acgourley thank you so much!! Now work in mac m2 pro!!
If anyone need it, these are the precise steps I followed:

  1. In the UnityStandaloneFileBrowser folder, go to Plugin -> MacOS -> StandaloneFileBrowser
  2. Show package contents of StandaloneFileBrowser.xcodeproj
  3. Open the project.pbxproj file with Xcode
  4. Change the line ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; to ARCHS = "$(ARCHS_STANDARD)";
  5. Remove the line VALID_ARCHS = x86_64;
  6. Save the file and close Xcode
  7. Go back to the Plugin -> MacOS -> StandaloneFileBrowser folder
  8. Open StandaloneFileBrowser.xcodeproj with Xcode
  9. Perform the build. A StandaloneFileBrowser.bundle file will be created
  10. Go to the folder where the file was just created (you can find it in Xcode by going to Product -> show build folder in finder)
  11. Copy the StandaloneFileBrowser.bundle file
  12. Replace the existing file in the /StandaloneFileBrowser/Plugins/folder

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

Would you be able to upload/send your latest bundle file for us to use? It would be super helpful. Thanks!

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants