Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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:
    63
    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:
    5,078
    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.