.netmacosavalonianotarization

MacOS app notarization failed - The signature of the binary is invalid


The app is developed by using Avalonia and .net core. I notarized the app and not get any errors. But I got the following error when check the result of the app notarization:

 "issues": [
    {
        "severity": "error",
        "code": null,
        "path": "Untitled.zip/XXX.app/Contents/MacOS/XXX",
        "message": "The signature of the binary is invalid.",
        "docUrl": null,
        "architecture": "x86_64"
    }
]

From the issue's description, it was caused by the codesign,b but it ditnot occur with any errors when signing.

Thanks for any ideas. Aaron

Eidted: The app works fine before signing. After signing, it fails. I try to run it in Terminal of MacOS ( cd to xxx.app/Contents/MacOS folder and excute ./xxx), and got the following error:

Failed to create CoreCLR, HRESULT: 0x80004005

Solution

  • In the end, I found the reason,which is because of the xxx.entitlements file. The first .entitlements is created on the window machine and then manually changed the extention, then used it on the Mac and codesigned successfully, but the notarization of my appp failed.

    The solution is to create a new .entitlements file on the Mac by vim comand rathen than the above and it codesigns and notarizes successfully.

    It's my stupid. My first Mac App works fine now. :)

    Thanks for others' helps and suggestions.