Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug System.Diagnostics.Process.Start() does not work at macOS for 2020.3

Discussion in 'Editor & General Support' started by AntonPetrov, Dec 7, 2023.

  1. AntonPetrov

    AntonPetrov

    Joined:
    Dec 27, 2013
    Posts:
    67
    Hi!

    I need
    System.Diagnostics.Process.Start()
    for our in-editor tools, but running this script on macOS fails with the error:

    Code (CSharp):
    1. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32
    2. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.dylib
    3. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.so
    4. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.bundle
    5. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/Kernel32
    6. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32
    7. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.dylib
    8. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.so
    9. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.bundle
    10. Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32
    11. Win32Exception: ApplicationName='aarch64-linux-android-objcopy', CommandLine='', CurrentDirectory='/Applications/Unity/Hub/Editor/2020.3.43f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin', Native error= mono-io-layer-error (2)
    12.     at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x002dc] in <1e13855442cf491a8b11d7de866cc016>:0
    13.     at System.Diagnostics.Process.Start () [0x0003a] in <1e13855442cf491a8b11d7de866cc016>:0
    14.     at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
    Looks like Process.StartWithCreateProcess() is implemented as P/Invoke into kernel32.dll but I cannot confirm this. I see people are using
    Process.Start()
    on Macs.

    Any ideas?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,263
    Try the simplest version: Process.Start some bash script that does nothing more than return an exit code or log something.

    It‘s probably an issue of the command, path or arguments not well formed or simply a permission issue - remember that on osx you have to flag a bash script as executable with chmod +x otherwise it cannot run.