Error occurred during export, Codesign failed

Hello,

From last few days I am facing one strange problem while archiving my app using developer id signed. I am getting an error when I try to export archive saying "Error occured during export, code sign failed". I am also getting this log in the console signature too large to embed (size limitation of on-disk representation). I also noticed one strange thing, archive export works fine for project written in pure Objective C language and this problem exists for project written in pure swift and objective C + swift mixed language. I also checked provision profile and other certificates, everything is fine (No expired certificates).

Can anyone please provide solution for this?


Regards,

Rohith Nayak

A very basic thing to start with: did you clean the build Folder ? With option-clean.

Hi,

We have the same issue with two diffent machines using the same certificate. This issue started today. Even if we try to sign code that was ok last week.


Edit: And yes we tried a clean rebuild we even tried to remove ~/Library/Developer/Xcode/DerivedData/

Today the "TÜBİTAK UEKAE Kök Sertifika Hizmet Sağlayıcısı - Sürüm 3" (included in System-Roots) Certifiate expired can this cause an error within signing or the keychain?

Ok removing the expired certificate didn't change anything. I took a quick look into the libsecurity source code to see when this error is thrown. It's either when some extended attributes are too long or when the codesign blob is longer than the allocated space within the Mach-O binary.

I can't see which one of those two cases applies here.


But it only happens while signing a Framework. In our case it was either while signing the Swift AppKit Framework or in another project the QtGui Framework.


We did not change our project settings, source code, installed developer tools or certificate. It just stopped working over the weekend! We already tried different versions of XCode to fix it. Can there be an issue with the size of a timestamp in codesign? The time is the only thing that changed.

Hello BoBKelso,

Is the above problem solved? Please provide solution/fix if you find any.


Regards,

Rohith Nayak

Hi rohithnayak,

I'm afraid not. If I set


OTHER_CODE_SIGN_FLAGS=--signature-size=9216

or

OTHER_CODE_SIGN_FLAGS=--timestamp=none

the archiving works again but the export still fails since those flags are ignored during export. But I don't know why it fails all of a sudden. It worked last week on Friday, without any changes from our side it stopped working over the weekend. This is very concerning to me.


I opened a bug report and a ticket with Apple, lets see what they suggest.


Best Regards,

Timo

Hello Timo,

For us also it stopped working last week all of a sudden without any code changes from our side. I am glad to hear that you have reported it to apple. We will also report the same.


Regards,

Rohith Nayak

The problem has solved now.

I just checked. Yes it works again. This is very concerning. Again we didn't make any changes and it started to work again. Does that mean that it can fail again at any given point in time?!

Error occurred during export, Codesign failed
 
 
Q