2

After upgrading to the latest versions of Visual Studio for Mac, Xamarin, and Xcode, I am unable to create a signed IPA archive. Everything runs on the simulator, everything builds fine in my release configuration. I can even create the archive just fine. But after I click "Sign and Distribute", regardless of whether I try to publish to the App Store or simply save the IPA to disk, I get the extremely generic "Failed to create IPA archive" message with no other detail about what failed.

As always with these types of problems, this worked the last time I tried to publish (2 months ago). Even trying to use "Sign and Distribute" on an archive I previously published successfully to the App Store fails with the same message. Are there any logs for this where I can see exactly what is failing? The Archive output window at the bottom of the screen doesn't show activity for this stage of the process.

UPDATE:

After finding the logs, was able to see the following error that shows that for some reason after upgrading the apps, permissions were somehow lost for creating the zip archive:

zip -r -y "/Applications/Xcode.app/MyApp.ipa" Payload
zip I/O error: Permission denied
zip error: Could not create output file (/Applications/Xcode.app/MyApp.ipa)
zip exited with code 15
ERROR:Failed to create IPA archive.
Finshed

So now the question becomes why, and what steps need to be taken to fix this the proper way (i.e., not just brute-forcing broad permissions)?

Granicus
  • 854
  • 10
  • 19
  • Is the problem happen if you create and "Sign and Distribute" a new project? If so, report a problem to [Developer Community](https://developercommunity.visualstudio.com/spaces/8/index.html). – nevermore May 04 '20 at 09:50
  • Correct, it happens after build is successful, when I click "Sign and Distribute." It occurs on new and previously-working archives. I was really just trying to find out if there are any logs I can look at to identify detail on this very generic error message. I will still go and report it at that link. Thank you. – Granicus May 04 '20 at 13:03
  • You can go to "Help -> Open Log Directory" to check the logs there to see if there is any useful information. Here is doc about [Mac logs](https://learn.microsoft.com/en-us/xamarin/cross-platform/troubleshooting/questions/version-logs#mac-logs). – nevermore May 05 '20 at 07:03
  • Thank you @JackHua-MSFT that got me to the logs, which showed the actual error occurring. Question has been updated to reflect the new information. – Granicus May 05 '20 at 13:42
  • The error is permission denied while it seems not enough to find out the root cause. I would still recommend you to send a [feedback](https://learn.microsoft.com/en-us/visualstudio/releasenotes/vs2019-mac-relnotes#feedback). You can also have a try to change MyApp.ipa with a short name if it is very long. – nevermore May 06 '20 at 03:10
  • @JackHua-MSFT - Thanks. I did submit feedback the other day. I received a response a short bit ago today stating that it may be due to saving the IPA in the XCode.App folder and to try a different location. I am going to try that guidance, but this folder is the folder VS has always defaulted to with the Save dialog, so even if changing the save location works then it's still a change in behavior. – Granicus May 06 '20 at 19:42
  • That was it. Could have been user error, but the default save location changed to the Applications/XCode folder at some point and I didn't realize it. – Granicus May 06 '20 at 22:24
  • I summarized some points in our comment and write them in an answer, can you please mark it so that we can help more people with same problem:). – nevermore May 07 '20 at 06:02

2 Answers2

2

Are there any logs for this where I can see exactly what is failing?

To find Mac logs through:

You can select the Go > Go to Folder menu item in Finder, and then copy and paste any of these paths into the dialog.

Visual Studio for Mac

  • ~/Library/Logs/VisualStudio/7.0 (this number may change depending on the version you are using)
  • This folder can also be opened via "Help -> Open Log Directory".

If you meet the Permission denied error in the log, this may be due to saving the IPA in the XCode.App folder. You can try a different location.

If you still meet problem, you can send a feed back inside visual studio for more help.

nevermore
  • 15,432
  • 1
  • 12
  • 30
0

It's very likely due to permission issue while zipping the archive.

To check if it's your case:

  • Open the log folder at ~/Library/Logs/VisualStudio/7.0 or in Visual Studio for Mac Help > Open Log Directory
  • Find and open the last log file for publishing (like Publishing.yyyy-mm-dd__hh-mm-ss.log)

Scroll to the last rows of that file. If it contains something like this (see the block below) so it's your case

zip I/O error: Permission denied
zip error: Could not create output file (/Applications/Xcode.app/YourApp.ipa)
zip exited with code 15
ERROR:Failed to create IPA archive.
Finished

In this case, once you see Output IPA file popup, just choose other save location (Desktop for example) Change save location to Desktop

Alex Logvin
  • 766
  • 10
  • 12