Common Issues with Xamarin iOS


layout: post
title: Common Issues with Xamarin iOS
date: 2021-08-21 15:57 +8
description: Various personal issues encountered when compiling and deploying with Xamarin iOS
toc: false
share: true
comments: true
tags: Xamarin iOS Development VisualStudio

Study Notes

Testflight

  1. Since uploading to the store may encounter unforeseen issues (thanks to Apple), it's best to upload a new version a week before the app expires!
  2. As long as the Testflight app has not expired, you can reuse the original version number by just incrementing the Build Number. This way, users don't need to reload the app, and you don't have to wait for Apple's review.
  3. The review process usually takes about two to three days.

Visual Studio 2019 (Windows) + macOS on VMWare Workstation Pro

Q: Uploading keeps showing "altool" exited with code 1.?

It might be that the app-specific password is incorrect or the SDK is outdated, so update XCode and Visual Studio.
Visual Studio can't display the exact error; to see the exact error, go to macOS's XCode > Windows > Organizer and upload manually.
The last screen will show the reason.

Q: Provisioning Profile disappeared? Isn't it supposed to work automatically if you have a subscription?

Delete the %localappdata%\Temp\Xamarin\XMA folder and restart VS.

Q: Unable to upload to the store in macOS either, saying a new SDK is required?

Congratulations, you'll need to start from scratch—download the latest OS dmg from your current macOS, then convert it to an iso file directly in macOS. Don't use Windows's dmg2iso; I tried and it failed.
Don't download VMWARE IMG from the internet, as it's meant for people without macOS and has many bugs and performance issues. It can't be updated, so just download the official latest version.
Once the OS is sorted, download the latest XCode. Then update Visual Studio on Windows (VS version and XCode are interdependent; once upgraded, you can't downgrade, and you won't find detailed historical versions online).
Follow Microsoft's instructions to generate new Provisioning Profiles and Certificates. Manually download them in both VS and XCODE to see if they appear in the list. Restart macOS, restart VS, and delete the XMA folder.

Q: Can't delete %localappdata%\Temp\Xamarin\XMA, files are in use?

End the Broker and IOS tasks in Task Manager, or use Process Hacker 2 to search for XMA.

Q: iOS Release Build takes forever!?

Stay calm~ Wait for ten minutes. Debug builds are faster, which is normal, probably because ARM is slower than X86.

Q: Upload To Store shows empty Profile and Certificate

The Certificate generated by macOS is tied to the OS, so generate new Profiles and Certificates in the Apple Developer Account.
Download the new Profile in XCode settings and in Visual Studio settings.

Q: Authenticate Service not available.

A1: Too many frequent operations, Apple locked it for an hour.
A2: Check the Developer Account to see if new terms need to be accepted. Without acceptance, this message will appear.

Q: After generating a new Certificate in macOS, VS shows Not in keychain?

It means the Certificate is not in the macOS keychain, so download it from the Certificate creation page and import it into the Login keychain. Don't put it in System or iCloud.

Q: Even though it's in Login, the Certificate shows an error in red instead of Valid?

The Developer Relations Intermediate Certificate might have expired, so download it from https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer and import it. Then redo the Certificate generation steps.
Reference: https://developer.apple.com/forums/thread/662300

Q: Can connect to macOS, but Build, Archive, or Distribute shows cannot connect to macOS?

Delete the %localappdata%\Temp\Xamarin\XMA folder and restart VS and macOS.

Thoughts

Using Visual Studio on Windows connected to macOS on VMWare is a great combo for budget-conscious developers.
This year I convinced the company to buy an M1 Mac Mini 16G/512G 1G, and the build speed is much faster! The emulator opens instantly.
The downside is I can only use Visual Studio Community for Mac
since, unlike on Windows, Visual Studio Enterprise isn't readily available on the internet (?).

Facebook 留言

Posted in Mobile Apps R&D, R&D.

Leave a Reply

Your email address will not be published. Required fields are marked *