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

1.9k views Asked by At

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
3

There are 3 answers

0
Aaron Wang On BEST ANSWER

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.

0
Whiletrue On

If you create a DMG, you must notarize the .app first (just zip it, notarize and after staple the .app). Then notarize the dmg.

Without those 2 steps I also got the same issue as yours.

With this app you can verify the signature and notarisation : https://www.mothersruin.com/software/Apparency/

0
Shaiful Islam On

This might be a problem,MacOS folder must contain only executable files