Xamarin iOS app distribute - failed to codesign

Yaşar YY 166 Reputation points
2021-03-09T10:15:53.94+00:00

Hello,

When I try to distribute Xamarin.Forms ios app to app store, VS gives below error:

Could not create ipa file for distribution of the archive 'Fit Tolerance ANSI'
/usr/bin/codesign exited with code 1

Failed to codesign 'D:/VisualStudio/ames/fittoleranceansi/fittoleranceansi/fittoleranceansi.iOS/obj/iPhone/Release/archives/fittoleranceansi.iOS 3-08-21 10.34 AM.xcarchive/Products/Applications/fittoleranceansi.iOS.app//**/*.metallib': /Users/user919742/Library/Caches/Xamarin/mtbs/builds/fittoleranceansi.iOS/072124e55de6a6ff0ff2d2d1bfec16502b437586de971b6e9cad7e31762c61d8/D:/VisualStudio/ames/fittoleranceansi/fittoleranceansi/fittoleranceansi.iOS/obj/iPhone/Release/archives/fittoleranceansi.iOS 3-08-21 10.34 AM.xcarchive/Products/Applications/fittoleranceansi.iOS.app//**/*.metallib: No such file or directory

Publishing project 'Fit Tolerance ANSI' completed with errors.

This app exists for several years at the store, this is the first time I received an error like this. I have 2 very similar apps with the same setup and they distribute as expected. All apps use same distribution certificate (not expired), with different appIDs hence different distribution profiles with the same expiration date.

At VS project properties > ios bundle signing, manual provisioning and corresponding team id and profile are selected.

At mac, I see the certificate at keychain access, with codesign is in always allowed list.

Projects and solution is cleaned, bin+obj+cache folders are deleted. App rebuilds and archives successfully, but cannot be distributed to app store. At distribute dialogs, team id and profile are shown and selected. I also tried "save as" app store ipa file locally and Ad Hoc distribution options but those all have given the same error, cannot reaching to the phase which it asks for app-specific password. Can anyone please give any advice to solve this?

Tool versions: VS 2019 Version 16.9.0, Xamarin 16.9.000.271, Xamarin.iOS 14.14.2.5, macOS Catalina 10.15.7

Regards,
Yasar

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,295 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Yaşar YY 166 Reputation points
    2021-03-11T08:50:43.387+00:00

    So, I cannot solve the main problem, but found a workaround. I can distribute at Xcode. After app rebuilds and archives successfully at VS, go to mac, at Xcode, select Window > Organizer. Projects which are archived at VS will show up here. Select the project and click Distribute App. Follow dialog prompts and app will be uploaded to app store connect.

    If I manage to find a solution to the main problem, I will write it here as well.

    6 people found this answer helpful.

  2. Yaşar YY 166 Reputation points
    2021-04-14T10:05:56.99+00:00

    Since there are noteworthy amount of people having this issue, I've reported this to the VS team. You may consider upvoting this issue at the link below:

    https://developercommunity.visualstudio.com/t/Xamarin-iOS-app-distribute---failed-to-c/1398018

    2 people found this answer helpful.
    0 comments No comments

  3. Paulo Martins 11 Reputation points
    2021-04-28T17:33:30.73+00:00

    Solved my problem by updating "Developer Relations Intermediate Certificate".
    https://developer.apple.com/forums/thread/662300

    2 people found this answer helpful.
    0 comments No comments

  4. Raphael Yaadar 1 Reputation point
    2021-05-03T23:35:56.067+00:00

    Facing a similar issue. The workaround (uploading with Xcode) worked. Thanks!

    0 comments No comments

  5. Dave 1 Reputation point
    2021-08-27T10:35:07.283+00:00

    I too am having this issue now. It only started happening for me after a recent VS update to fix other iOS related issues I was having (first the iOS emulator mirroring in Windows was broken, then the fix for that broke the keyboard integration). After grabbing the most recent update to fix the emulator keyboard issue, the archiving is now broken. It seems like one fix breaks something else at the minute? I already installed the above metioned certificate a few months ago, so its not that. Any other ideas? Thanks.

    0 comments No comments