Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Enable Hardened Runtime through Xcode, App won't start

Discussion in 'macOS' started by tjmaul, Mar 14, 2021.

  1. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    464
    Hello everybody,

    macOS 11.2.1
    Unity Editor 2021.1.0b11
    Xcode 12.4

    Building a fresh URP template, build settings:
    Bildschirmfoto 2021-03-14 um 11.31.43.png
    Open the project with Xcode, verify that clicking the "Build and Run"-Button let's you play the sample scene.
    Then go to the project settings, find "Signing" and set "Enable Hardened Runtime" to "Yes". Try running it again. For me, it crashes.
    Code (CSharp):
    1. dyld: Library not loaded: @executable_path/../Frameworks/UnityPlayer.dylib
    2.   Referenced from: /Users/timomaul/Library/Developer/Xcode/DerivedData/macos-gcrixaqlpknzrvalsyrfxvvzuhga/Build/Products/Debug/Notarization Test.app/Contents/MacOS/Notarization Test
    3.   Reason: no suitable image found.  Did find:
    4.     /Users/timomaul/Library/Developer/Xcode/DerivedData/macos-gcrixaqlpknzrvalsyrfxvvzuhga/Build/Products/Debug/Notarization Test.app/Contents/MacOS/../Frameworks/UnityPlayer.dylib: code signature in (/Users/timomaul/Library/Developer/Xcode/DerivedData/macos-gcrixaqlpknzrvalsyrfxvvzuhga/Build/Products/Debug/Notarization Test.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?)
    5.     /Users/timomaul/Library/Developer/Xcode/DerivedData/macos-gcrixaqlpknzrvalsyrfxvvzuhga/Build/Products/Debug/Notarization Test.app/Contents/MacOS/../Frameworks/UnityPlayer.dylib: code signature in (/Users/timomaul/Library/Developer/Xcode/DerivedData/macos-gcrixaqlpknzrvalsyrfxvvzuhga/Build/Products/Debug/Notarization Test.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?)
    6.     /Users/timomaul/Library/Developer/Xcode/DerivedData/macos-gcrixaqlpknzrvalsyrfxvvzuhga/Build/Products/Debug/Notarization Test.app/Contents/MacOS/../Frameworks/UnityPlayer.dylib: stat() failed with errno=1
    7.  

    I'm doing this to get my app notarized through Xcode, so I don't need to use the command line. Any other advice?
     
  2. ABirdJustDied

    ABirdJustDied

    Joined:
    Jun 8, 2020
    Posts:
    1
    I am having the same issue. Did you manage to resolve it?
     
  3. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    464
    I honestly don’t remember what I did but it stopped being a problem for some reason.

    Are you trying to get your game notarized so it doesn’t show that macOS security nag screen?

    Does your project build for macOS without using Xcode? I assume usually there is no need to go through Xcode and then you can notarize those binaries