question

YasarYY-7829 avatar image
5 Votes"
YasarYY-7829 asked RobCaplan edited

Xamarin iOS app distribute - failed to codesign

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

dotnet-xamarin
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Try to create a new App Id and try again .

0 Votes 0 ·

Since this is an update not a new app, I have to use the same app id.

1 Vote 1 ·

Still getting this - thanks for the work-around!

Has this issue been reported to the Visual Studio team via the Help | Send Feedback | Report a problem?
or a ticket somewhere that can be tracked?

0 Votes 0 ·

I have reported. I'm posting the link as a separate answer for potential upvoters.

0 Votes 0 ·
YasarYY-7829 avatar image
5 Votes"
YasarYY-7829 answered MattCraig-1467 commented

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I ran into this issue as well while trying to update an existing app. It's very strange that it seems to have come out of nowhere, would be great to get a fix for this. That said, I was able to use this workaround as well.
I noticed on my Mac sometimes the archives wouldn't show up right away. If you right click on an existing archive and click "Show In Finder" you can find the newest archive and double click to open it in the Organizer.

2 Votes 2 ·

Thank you! I was not able to find archives before your comment - "right click on an existing archive and click "Show In Finder" you can find the newest archive and double click to open it in the Organizer"

0 Votes 0 ·

I'm facing the same issue since the last VS 2019 update... Thanks for the hint with the workaround. This saved me!

1 Vote 1 ·

Awesome, thank you for posting. This error started for me after a recent update. Really appreciated you sharing this.

1 Vote 1 ·

Awesome, thanks I have been trying to work out for the last 2 weeks how to solve the inability to upload app distribution. Thanks for the work around as a solution until this gets fixed.

1 Vote 1 ·

Thanks so much for this!

Have had all sorts of unexpected issues trying to get a new build of a stable Xamarin iOS app done and released, and this was the final hurdle. Your workaround saved the day.

1 Vote 1 ·
YasarYY-7829 avatar image
2 Votes"
YasarYY-7829 answered

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


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PauloMartins-6608 avatar image
2 Votes"
PauloMartins-6608 answered PauloMartins-6608 published

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RaphaelYaadar-3107 avatar image
0 Votes"
RaphaelYaadar-3107 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Dave-4199 avatar image
0 Votes"
Dave-4199 answered Dave-4199 edited

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.