codesign entitlements syntax error

Hey, I'm trying to code sign my Mac OS X app. I generate entitlements file, but during execution of the command:
Code Block bash
codesign -f -s "DeveloperName"  -o runtime --timestamp ./App.app --entitlements app.entitlements

it gives me the next error:
Code Block bash
Failed to parse entitlements: AMFIUnserializeXML: syntax error near line 12

In the file I have a date value field on the line 12:
Code Block xml
<key>ExpirationDate</key>
<date>2038-01-31T11:46:58Z</date>

If I move the date on the other line, codesign shows the error line number according to the new line number. If I removed

I used plutil commands from the Apple article, and the utility show that everything is ok, but it make no sense for codesign.

Mac OS X version: 10.15.7

How can fix it and sign the app with entitlements file?

Replies

you can run plutil -convert xml1 <your_entitlements_file> to verify the xml is in exactly the right format.