Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

File Browser - Native file browser

Discussion in 'Assets and Asset Store' started by Stefan-Laubenberger, Dec 28, 2017.

  1. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,757
    Sorry for the trouble! If it makes any easier, you can use a new API we added to resign the .app after you modified its contents:

    Code (csharp):
    1. UnityEditor.OSXStandalone.MacOSCodeSigning.CodeSignAppBundle("/path/to/bundle.bundle")
     
    Last edited: Mar 24, 2021
    Stefan-Laubenberger likes this.
  2. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    If you like, please try our fix:
    1. Open the file "Info.plist" under "Assets/Plugins/crosstales/FileBrowser/Libraries/macOS/FileBrowser.bundle/Contents"
    2. search for the text "com.crosstales.fb.macOS"
    3. replace it with your bundle id

    This will be automated in the next release!
     
  3. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    Hi Stefan - just tried your fix and it doesn't seem to work. Getting the same error when trying to resign:

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: fatal error: file not in an order that can be processed (code signature data out of place): /path/to/App.app/Contents/PlugIns/FileBrowser.bundle/Contents/MacOS/FileBrowser


    Any ideas? Many thanks
     
  4. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Hi

    What were your steps?
    Did you just change the bundle id or did you also sign the package as in the answer from @Tautvydas-Zilys ?
     
  5. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    Thanks for the prompt reply!

    I changed the bundle id, rebuilt, and then tried signing with the following command:
    codesign -o runtime -f --deep -s '[id_number]' --entitlements "[pathToEntitlements.entitlements]" "path/to/App.app"


    I assumed that the above is the equivalent of the suggestion from @Tautvydas-Zilys?

    If it's a required step of the process, could you point me in the direction of how to actually use this?:
    UnityEditor.OSXStandalone.MacOSCodeSigning.CodeSignAppBundle("/path/to/bundle.bundle")


    Does it have to be called from within Unity as a post-build process or something?
     
  6. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Unfortunately, my Mac is currently been repaired, so I can't test it atm.
    I would assume you have to add the Unity-function into a build post-processor.

    Can you please send me your edited "Info.plist"? Maybe it's best if we talk via email.
     
  7. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    Sure thing - will e-mail you now. Thanks
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,757
    Unfortunately this is a bug in Unity that I am currently fixing. Our current codesigning code sometimes signs the code in a way that makes it unsignable from codesign afterwards. It's tracked here and I'm trying to the fix into Unity 2020.3 ASAP:

    https://issuetracker.unity3d.com/is...ignature-data-out-of-place-out-of-place-error

    To workaround, you can sign everything apart from the main executable via Unity. At the end of OnPostprocessBuild in "crosstales\FileBrowser\Editor\Util\BuildPostprocessor.cs", you'd add these code lines:

    Code (csharp):
    1. #if UNITY_STANDALONE_OSX
    2.                 UnityEditor.OSXStandalone.MacOSCodeSigning.CodeSignAppBundle(Path.Combine(pathToBuiltProject, "Contents/PlugIns/FileBrowser.bundle"));
    3. #endif
    Then from command line, you'd do your exact same signing again, except without the --deep flag:

    Code (csharp):
    1. codesign -o runtime -f -s '[id_number]' --entitlements "[pathToEntitlements.entitlements]" "path/to/App.app"
     
    Stefan-Laubenberger likes this.
  9. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    OK that seems to have done something! Am now getting:
    codesign -o runtime -f -s 'developer_id' --entitlements "pathToEntitlements.entitlements" "pathToApp.app"
    App.app: replacing existing signature
    App.app: code object is not signed at all
    In subcomponent: pathToApp.app/Contents/Frameworks/UniversalDeepLink.framework


    Looks like FileBrowser is fine, and now I've got issues with UniversalDeepLink.framework instead?
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,757
    Looks like it. .framework plugins are complicated in the first place because if you put them on Windows or Linux filesystem, they get "destroyed" as it invalidates the symlinks inside. Unity doesn't sign them or even support them as plugins right now - this one must have been copied to your app by another postprocess script.

    You can just sign it manually from command line before signing the .app itself:

    Code (csharp):
    1. codesign -s 'developer_id' -f pathToApp.app/Contents/Frameworks/UniversalDeepLink.framework
     
  11. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    OK great, that seemed to work.

    However now I'm getting this: Screenshot 2021-03-25 at 20.02.23.png

    Followed by this in the report:
    Code (CSharp):
    1. Dyld Error Message:
    2.   Library not loaded: @executable_path/../Frameworks/UnityPlayer.dylib
    3.   Referenced from: /Users/USER/*/VoltaCreateMac-21-03-25.app/Contents/MacOS/Volta Create
    4.   Reason: no suitable image found.  Did find:
    5.     PathToApp.app/Contents/MacOS/../Frameworks/UnityPlayer.dylib: code signature in (PathToApp.app/Contents/MacOS/../Frameworks/UnityPlayer.dylib) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
    Do the instructions on this page still hold true? Also let me know if I should post this elsewhere, as this is no longer actually to do with FileBrowser...
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,757
    You can post this to macOS forum: https://forum.unity.com/forums/macos.95/

    It seems like macOS wants all binaries to be signed with the same team id (codesign -s 'developer_id' part). You could try resigning all the binaries with it.
     
  13. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    OK FYI I seem to have resolved a lot of the codesigning issues by creating an XCode project from Unity, sorting all the required entitlements within Xcode, and then building from there. However I'm now having another issue...

    Anyway, thanks for the help with the FileBrowser stuff!
     
    Stefan-Laubenberger likes this.
  14. julienkay

    julienkay

    Joined:
    Nov 12, 2013
    Posts:
    62
    I'm trying to use async/await with FileBrowser Pro. The reason I'm not just using OpenFilesAsync is, that the callback function is invoked from a background thread, so I can't use any Unity API in there and first have to clunkily pass the result back to the main thread. The Async/await pattern could make that a lot cleaner..

    However I'm having trouble getting it to work. Wrapping the synchronous OpenFiles causes Unity to throw an error "Fatal error! The current working directory was changed from '/Users/<username>/<project>' to '...'. This is not allowed. (...)" and hard-crashes the editor.
    Wrapping OpenFilesAsync with an async utility method has proven difficult. Has anyone gotten this to work and has any advice for me?
     
  15. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Hi Julien

    I maybe don't understand the problem - you can simply subscribe to one of the events or calling it with an Action. The Unity API would still work while the browser is open.
    Or what exactly are you doing?

    The second issue only happens inside the Editor and can be prevent by disabling "Native Inside Editor" in the configuration:
    upload_2021-3-29_19-59-56.png


    Cheers
    Stefan
     
  16. julienkay

    julienkay

    Joined:
    Nov 12, 2013
    Posts:
    62
    Hi Stefan,

    thanks for the quick reply.

    I was talking about the legacy OpenFilesAsync methods and specifically using the Unity API inside the callback. If you do this:
    Code (CSharp):
    1.  
    2. private void Start() {
    3.     FileBrowser.Instance.OpenFilesAsync(OnFilesSelected, ...);
    4. }
    5.  
    6. private void OnFilesSelected(string[] selected) {
    7.     GameObject g = new GameObject("");
    8. }
    Unity will throw "UnityException: Internal_CreateGameObject can only be called from the main thread."

    After reading your comment I went on to install the newest version of File Browser Pro and noticed that these methods have an Obsolete Attribute that was commented out? And there are now other async methods, where you don't pass an action, but instead are able to use the global events. I think those are the ones you mentioned (OpenFilesComplete). These are indeed called from the main thread, which improves the situation. At least these can be used without needing to worry about using the Unity API in the callback.

    However, I still think the async/await pattern (as outlined in this blog post) would make this even simpler.

    Essentially this would allow to simply write:
    Code (CSharp):
    1. private async void Start() {
    2.     string[] selectedFiles = await FileBrowser.Instance.OpenFilesAsync(...);
    3.  
    4.     // do stuff with selectedFiles
    5. }
     
    Stefan-Laubenberger likes this.
  17. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    We will look at an async-implementation in the near future.
    Thank you for your valuable suggestions!
     
    julienkay likes this.
  18. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    Hi @Stefan-Laubenberger ,

    Apologies if this is addressed earlier in the thread (I did a search but couldn't find anything), but do you know why this keeps happening? Happens every time we close Visual Studio. We're not making any changes to any but our own scripts etc.:
    upload_2021-4-1_10-35-36.png
     
  19. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Unfortunately, I never heard of this issue before. Also we're using Rider for the development, so it behaves differently.
    However, do you have more details on what exactly changed?
    Maybe a asmdef in the "crosstales"-folder solves the issue?
     
  20. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    748
    @Stefan-Laubenberger Hi Stefan, we recently updated File Browser Pro to the latest version, running Unity 2021.1.0f1 on Windows 10 and we're seeing a couple of bugs:

    - When using FileBrowser.Instance.OpenSingleFolder() while running in the editor we see the normal ("full version") of the Windows file browser (folders on the left, content on the right), but when running the same command in a build we see the "small square" version of the file browser (the one with only folders stacked on top of each other). Would it be possible to see the same browser interface both in the editor and a build?

    - Calling any command to browse for a file or a folder in a build results in the app disappearing right away (it actually minimizes down to the task bar). That's of course a problem. Note that this doesn't happen when the app is running in the editor (I mean the Unity editor doesn't minimize). Also, this happens when the app is full-screen.

    For what it's worth those issues didn't happen in Unity 2019.3.

    Could you please have a look into this? Thank you.
     
    Last edited: Apr 10, 2021
  21. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Hi Seith

    I just did a test with Unity 2021.1.2 and FB 2021.1.2 and the window isn't minimized in the build.
    These are my player settings:
    upload_2021-4-11_15-43-19.png

    To see the new folder browser, you will need to enable "IL2CPP":
    upload_2021-4-11_15-44-21.png

    I hope this helps you further.


    Cheers
    Stefan
     
  22. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    748
    Thank you very much for your help, Stefan. That did the trick! :)
     
    Stefan-Laubenberger likes this.
  23. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13

    Hi Stefan,

    Me again - this time running into the same issue as @megavoid-de. I've tried reubilding FileBrowser from the source via XCode and replacing the .bundle, however no luck. Here are the errors being thrown in the console:
    Code (CSharp):
    1. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser
    2. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.dylib
    3. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.so
    4. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.bundle
    5. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/FileBrowser
    6. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser
    7. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.dylib
    8. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.so
    9. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.bundle
    10. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser
    11. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser
    12. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.dylib
    13. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.so
    14. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.bundle
    15. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/FileBrowser
    16. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser
    17. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.dylib
    18. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.so
    19. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser.bundle
    20. Fallback handler could not load library /Users/volta/Library/Developer/Xcode/DerivedData/Builds-dnakqkdjcpoocqbvnsdqvockvrlj/Build/Products/Debug/Volta Create.app/Contents/Frameworks/MonoEmbedRuntime/osx/libFileBrowser
    21. DllNotFoundException while executing 'performed' callbacks of 'UI/Click[/Mouse/leftButton,/Pen/tip]'
    22.  
    23. DllNotFoundException: FileBrowser
    24.   at (wrapper managed-to-native) Crosstales.FB.Wrapper.Mac.NativeMethods.DialogOpenFilePanel(string,string,string,bool)
    25.   at Crosstales.FB.Wrapper.FileBrowserMac.OpenFiles (System.String title, System.String directory, Crosstales.FB.ExtensionFilter[] extensions, System.Boolean multiselect) [0x00008] in <976765f6ad9f485795551cb3c725983b>:0
    26.   at Crosstales.FB.Wrapper.FileBrowserBase.OpenSingleFile (System.String title, System.String directory, Crosstales.FB.ExtensionFilter[] extensions) [0x00000] in <976765f6ad9f485795551cb3c725983b>:0
    27.   at Crosstales.FB.FileBrowser.OpenSingleFile (System.String title, System.String directory, Crosstales.FB.ExtensionFilter[] extensions) [0x00012] in <976765f6ad9f485795551cb3c725983b>:0
    28.   at Crosstales.FB.FileBrowser.OpenSingleFile (System.String extension) [0x0001a] in <976765f6ad9f485795551cb3c725983b>:0
    You mentioned you don't have access to an M1 Mac - I'd be more than happy to let you take remote control of mine to experiment with a few fixes, if you like.

    Thanks,
    Yuli
     
    Last edited: Apr 13, 2021
  24. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    (Can also confirm that this is only an M1/Metal issue - same build working fine on my Intel Mac)
     
  25. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Unfortunately, we don't own an M1 Mac and can't currently build the bundle for the new architecture.
    The source code is part of the asset - this way you could compile the bundle on the M1.
    If you do so, it would be very friendly if you could give us access to the new bundle ;)
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    We've just released version 2021.2.0 of File Browser.
    Main changes:
    • Support for WebGL Native File Browser added
    • FileBrowser: canOpenFile, canOpenFolder, canSaveFile and CurrentOpenSingleFileData added
    • Fix for macOS builds
    • Updated to Common 2021.2.0

    It's also on sale, grab it while you can ;)
     
    julienkay likes this.
  27. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    Hi Stefan,

    I actually left you a much longer message just above this one explaining the issue in more detail, but the message is stuck in review by the mods, it would seem.

    I actually tried recompiling from source, but no change unfortunately. I also offered you to have remote access to my Mac if you would like to try recompiling, yourself? That offer still stands! :)

    Let me know.

    Y
     
  28. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Hello again

    I can't reject your generous offer for remote access - I just can't promise we can fix it. Apple eats my (our) nerves...
    Anyway, can you please send me an email with a proposed time? Maybe Discord would also be good enough ;)


    So long,
    Stefan
     
  29. yuli_volta

    yuli_volta

    Joined:
    Mar 22, 2021
    Posts:
    13
    Great - just e-mailed you - thanks!
     
  30. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    318
    Hi.

    After update to last version has this error:

    'FileBrowserBase' does not implement interface member 'IFileBrowser.canOpenFile'
    'FileBrowserBase' does not implement interface member 'IFileBrowser.CurrentOpenSingleFile'
    'FileBrowserBase' does not implement interface member 'IFileBrowser.CurrentOpenFiles'

    (...and other 12 with "filebrowerbase")

    Unity 2020.1.17f1

    Thanks.
     
  31. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Please make sure you've followed chapter 7 of the documentation:
    https://www.crosstales.com/media/data/assets/FileBrowser/FileBrowser-doc.pdf
     
  32. astorms

    astorms

    Joined:
    Jan 31, 2018
    Posts:
    45
    Hi @Stefan-Laubenberger ,

    I just bought your plugin today - it looks excellent! However, I have one small feedback request. Would it be possible for you to tweak the plugin such that it could all be contained in one parent folder that could be moved around anywhere in the Assets folder structure? At our company we keep all of our plugins in an Assets/_Third-Party folder to keep things organized, so what I'm imagining is being able to have something like Assets/_Third-Party/File Browser Pro/[all the files]. It seems that currently some of the paths to icons are hard coded to expect a certain folder structure.

    Thanks!
    Andrew
     
  33. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Hi Andrew

    Thank you for investing into FB!

    Our asset resides under "Asset/Plugins/crosstales" and you can move the complete crosstales-folder wherever you like.
    Please don't re-organize the content within the folder (except removing unwanted features).

    I hope this helps you further.
    If you have any additional questions don't hesitate to ask.


    Cheers
    Stefan
     
  34. musicdeveloper

    musicdeveloper

    Joined:
    Oct 16, 2019
    Posts:
    46
    Hello Stefan,

    Unfortunately, the issue with M1 Macs seems to still be present - I released a new version yesterday with 2021.2.1, and you can see the reports from my users here:
    https://www.visualmusicdesign.com/f...0015d8be05&commentId=6082f659de55f40016638533

    I know how frustrating this is - because I myself don't have an M1 Mac and have no plans to get one soon.

    I think I can downgrade for the moment - the users said the previous version of my app had worked fine, which was using File Browser PRO 2020.2.4.

    Thank you, and sorry to be the bearer of bad news!
     
  35. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Hi

    Please try the latest version 2021.2.3.

    Thank you for your patience!


    Regards
    Stefan
     
  36. musicdeveloper

    musicdeveloper

    Joined:
    Oct 16, 2019
    Posts:
    46
    Thank you - I'm only seeing version 2021.2.1 in the Asset Store? Is it awaiting approval?
     
  37. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Sorry my fault, I meant 2021.2.1.

    For the M1-builds, please make sure you're extracting "FileBrowser.bundle_M1.zip" under "Assets\Plugins\crosstales\FileBrowser\Libraries\macOS".

    Please let me know if it works for you.
     
  38. Philkrom

    Philkrom

    Joined:
    Dec 26, 2015
    Posts:
    66
    Hello Stefan, I just bought and tried this asset but there is something I don't understand. Using your Playmaker actions, I would like - for instance - to open a jpg or a text file in a folder, so far it works, then modify this file (for instance resize the image or find a string in the text file) and then save this resized image (or even the original jpg) in the persistent datapath of the app. This seems to be very very simple actions, but I don't understand how I can achieve them, and I am not a newbie in Playmaker. Could you explain or provide an example ? And some questions below :

    - What does the "selected" mean ?
    - What is the "send event" for ?
    - Is there a way to put the loaded file in a variable ?
    - If I want to open an image file, it would be great if I could have several extensions in the Extension parameter (for instance jpg or png or psd) is this possible ?

    Best regards, Phil
     
  39. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Hi Phil

    FB doesn't load or save files - it simply returns the selected path.
    You could use the ImageConversion-class from Unity:
    https://docs.unity3d.com/ScriptReference/ImageConversion.html

    About your questions:
    1. "selected" represents if the user has selected a file/folder (=true) or not (=false)
    2. We use the "send"-event to trigger the next action
    3. The name of the selected file is in the variable "Result Path"
    4. This is possible in the upcoming release - please send me your invoice via email and we will give you the new version
     
  40. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    413
    Hi, I just updated to the latest asset store version 2021.2.1 and unzipped the m1 bundle and replaced the original .bundle that was there (not sure if I'm supposed to keep both). However on the build I now get this error:

    Code (CSharp):
    1. DllNotFoundException: FileBrowser
    2.   at (wrapper managed-to-native) Crosstales.FB.Wrapper.Mac.NativeMethods.DialogOpenFilePanel(string,string,string,bool)
    3.   at Crosstales.FB.Wrapper.FileBrowserMac.OpenFiles (System.String title, System.String directory, System.String defaultName, System.Boolean multiselect, Crosstales.FB.ExtensionFilter[] extensions) [0x0001b] in <8f06ab2aaae04ac183a582f65771e3d1>:0
    4.   at Crosstales.FB.Wrapper.BaseFileBrowser.OpenSingleFile (System.String title, System.String directory, System.String defaultName, Crosstales.FB.ExtensionFilter[] extensions) [0x00000] in <8f06ab2aaae04ac183a582f65771e3d1>:0
    5.   at Crosstales.FB.FileBrowser.OpenSingleFile (System.String title, System.String directory, System.String defaultName, Crosstales.FB.ExtensionFilter[] extensions) [0x0001f] in <8f06ab2aaae04ac183a582f65771e3d1>:0
    6.   at Crosstales.FB.FileBrowser.OpenSingleFile (System.String title, System.String directory, System.String defaultName, System.String[] extensions) [0x0000c] in <8f06ab2aaae04ac183a582f65771e3d1>:0
    7.   at MCG.PointCloudConvertor.OpenPointCloud () [0x0001a] in <1cecb7f461994a6a8e0b8614cd63faa2>:0
    8.   at MCG.UIManager.ImportPointCloudButtonPressed () [0x00005] in <1cecb7f461994a6a8e0b8614cd63faa2>:0
    9.   at UnityEngine.Events.InvokableCall.Invoke () [0x00010] in <5b8d8f4b5d4348a99c173e45ee640497>:0
    10.   at UnityEngine.Events.UnityEvent.Invoke () [0x00022] in <5b8d8f4b5d4348a99c173e45ee640497>:0
    11.   at UnityEngine.UI.Button.Press () [0x0001c] in <10fc7e887d554e2a8e64506f53accff3>:0
    12.   at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00009] in <10fc7e887d554e2a8e64506f53accff3>:0
    13.   at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00007] in <10fc7e887d554e2a8e64506f53accff3>:0
    14.   at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00067] in <10fc7e887d554e2a8e64506f53accff3>:0
    15. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    16. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    17. UnityEngine.Logger:LogException(Exception, Object)
    18. UnityEngine.Debug:LogException(Exception)
    19. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
    20. UnityEngine.InputSystem.UI.InputSystemUIInputModule:ProcessPointerButton(ButtonState&, PointerEventData)
    21. UnityEngine.InputSystem.UI.InputSystemUIInputModule:ProcessPointer(PointerModel&)
    22. UnityEngine.InputSystem.UI.InputSystemUIInputModule:Process()
    23. UnityEngine.EventSystems.EventSystem:Update()
     
  41. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Are the import settings of the bundle still correct?
    It needs Xcode 11 or newer and the latest macOS to work.

    Are you building on M1 or Intel?


    Edit:
    You could try a Rosetta build on your M1 with the original bundle
     
    Last edited: Apr 26, 2021
  42. astorms

    astorms

    Joined:
    Jan 31, 2018
    Posts:
    45
    Thank you. I guess I was really referring to the use of the "Editor Default Resources" folder. Is there anyway for you to avoid that?

    Maybe my bigger question is this: do you have any plans to publish your asset as a UPM package so that we can simply specify it as a project dependency? That would be amazing.
     
  43. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    The "Editor Default Resources"-folder is the right way to store all assets that don't belong in a build.

    However, UPM is planned as soon as we drop the support for Unity 2018 later this year.
     
    astorms likes this.
  44. kylebjaynes

    kylebjaynes

    Joined:
    Dec 8, 2014
    Posts:
    6
    Hello,

    I dowloaded the FileBrowser, using Unity 2019.417f1 for windows, building for macOS. Everything works great in Unity editor. And works great in standalone as well if I switch my project build to Windows. But in standalone for Mac, when I select a file to be uploaded, the app crashes immediately and gives this error in the debugger. I've tried uninstalling the package and re-installing, closing and re-opening Unity, restarting the computer but nothing works. Please help as this is the only thing missing in my app. Thank you:

    Code (CSharp):
    1.  
    2.  
    3. NullReferenceException: Object reference not set to an instance of an object
    4.   at Crosstales.FB.Wrapper.FileBrowserMac.openFileCb (System.String result) [0x00021] in C:\Users\Kyle\Desktop\NFTbackup\NFTGenAssets\Plugins\crosstales\FileBrowser\Scripts\Wrapper\FileBrowserMac.cs:141
    5. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    6. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    7. UnityEngine.Logger:LogException(Exception, Object)
    8. UnityEngine.Debug:LogException(Exception)
    9. UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/UnhandledExceptionHandler.bindings.cs:46)
    10.  
    11. (Filename: C Line: 0)
    12.  
     
  45. kylebjaynes

    kylebjaynes

    Joined:
    Dec 8, 2014
    Posts:
    6
    My apologies if this was a foolish question- I figured it out. I was using the Open single file Async function. Just needed to use the regular open file function.

    Thanks!
     
    Stefan-Laubenberger likes this.
  46. Numa

    Numa

    Joined:
    Oct 7, 2014
    Posts:
    90
    Hi, sorry if this had been asked before, but is the free version gone from the store and no longer supported?
    Thanks!
     
  47. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Hi Numa

    Yes, the free version is deprecated since 2 years and is no longer supported.


    Cheers
    Stefan
     
    Numa likes this.
  48. musicdeveloper

    musicdeveloper

    Joined:
    Oct 16, 2019
    Posts:
    46
    Sorry for not responding - the older version continued to work until I updated to Unity 2020, and now my users are screaming at me again.
    I need to fix this ASAP - my app is broken on M1 after the newest update due to FileBrowser...


    - I am of course easily able to extract FileBrowser.bundle_M1.zip. However, I'm confused about where to go from here - the instructions seem incomplete.

    I can only submit one binary to App Store Connect, and it needs to be a Universal Binary - I can't make two completely different builds for my users. It seems a bit unreasonable to make a Rosetta build for the indefinite future just to acommodate FileBrowser.


    1. Why that isn't the M1 .bundle extracted by default?

    2. The bundle is named "FileBrowser 2.bundle" after extracting because the old one is still there. I'm assuming I need both for the app to run successfully on both Intel and Apple Silicon, so I don't think I can just delete the old one and rename? But if the new one continues to be named FileBrowser 2.bundle, I imagine it's not going to be found when the app loads?

    3. Do I need to select one bundle for Intel CPU, and one bundle for Apple Silicon in the Unity Editor?


    Thank you
     
  49. musicdeveloper

    musicdeveloper

    Joined:
    Oct 16, 2019
    Posts:
    46
    When I just extract the FileBrowser.bundle_M1.zip and replace the old framework with that FileBrowser.bundle, I get the following error in the Logs when running my app on Intel Mac:

    DllNotFoundException: Unable to load DLL 'FileBrowser': The specified module could not be found.
    at Crosstales.FB.Wrapper.Mac.NativeMethods.DialogOpenFilePanel (System.String title, System.String directory, System.String extension, System.Boolean multiselect) [0x00000] in <00000000000000000000000000000000>:0
    at Crosstales.FB.Wrapper.FileBrowserMac.OpenFiles (System.String title, System.String directory, System.String defaultName, System.Boolean multiselect, Crosstales.FB.ExtensionFilter[] extensions) [0x00000] in <00000000000000000000000000000000>:0
    at Crosstales.FB.Wrapper.BaseFileBrowser.OpenSingleFile (System.String title, System.String directory, System.String defaultName, Crosstales.FB.ExtensionFilter[] extensions) [0x00000] in <00000000000000000000000000000000>:0
    at Crosstales.FB.FileBrowser.OpenSingleFile (System.String title, System.String directory, System.String defaultName, Crosstales.FB.ExtensionFilter[] extensions) [0x00000] in <00000000000000000000000000000000>:0
    ...
     
  50. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,720
    Only one bundle should reside in the folder.
    Have you enabled "Intel" and "Apple Silicon" on the library?

    The problem is that we currently don't own a M1-Mac, so we can't really test it... The M1-bundle was built by one of our customers.
    Therefore, you could also build the bundle in Xcode from the source code and export it it for both architectures.
     
unityunity