iOS AppStore vs Adhoc code signing issue

The Code signing part of Apple is as always confusing the crap out of me.
I have an iOS app that I can compile successfully using the Xojo setting “Build for Development”, and using Xcode can copy to any devices I allowed it on. So far, so good.
When I change the setting in Xojo to build for AppStore and compile, during the Signing part of the progress bar, Xojo comes back to me (after 30-45 seconds) with an error:

The operation couldn’t be completed. 2025-01-24 14:53:47.354 xcodebuild[4453:38402] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/vr/kg0xh76d7v7ggtj2mdxwdtyh0000gn/T/myAppName-01-24_14-53-47.354.xcdistributionlogs".
error: exportArchive No profiles for 'nl.colorplaza.myAppName' were found

In the above I replaced the actual app name with “myAppName”

To which profile is this error referring to?
I have a Provisioning Profile that is active, for the App Store with iOS as a platform, and downloaded it from developer.apple.com and installed it by double clicking.
Is there a way to check the profiles used by Xojo in Xcode to perhaps get some better indication of the source of the issue?

Thanks in advance for any tips.

Download my APT tool. It can help you track this down.

https://www.stretchedout.com/yaxew/products/apt.html

1 Like

Hi @Boudewijn_Krijger

When it is about iOS apps:

  • You need to register a Explicit Identifier (nl.colorplaza.myAppName)
  • Then create a Development Profile for that app Identifier (this is the one used when Building the app and Code Signing > Build is set to “Development” in the Xojo IDE)
  • And create an App Store Connect Profile for that app Identifier. This will be the one used when Building the app and “AppStore” is set in Code Signing > Build in the Xojo IDE).

So, make sure you have both profiles (development and distribution) properly installed on your Mac. Usually that is done double-clicking the profile files once they are downloaded from the Apple Developer website.

Thanks Javier, The Identifier is correct and I do have a development profile and a distribution profile. What makes it confusing is that the naming (both on Apple platform and in Xojo documentation) isn’t concise, and the xojo documentation is outdated a lot.
I know Apple keeps changing things, but I think it would be nice if Xojo had up to date documentation for the latest version of Xojo in combination with the latest version of X-Code and the latest AppStoreConnect and Appledeveloper layout.
It should not be too difficult for Xojo to indicate which exact profile is missing or incorrect when an error occurs during compilation. Now it’s about as useful as “An error has occurred”

To be fair, this isn’t really xojos fault. They can’t (for instance) know everything that APT knows because they don’t use the App Store Connect API like I do. Also, Apple changes their pages two or three times a year now.

There are four pieces that you need defined at Apple:

  1. Application Identifier
  2. Your Developer Certificate
  3. A Development Profile
  4. A Distribution Profile

Please note that the order I have listed these is very important. Changes to the first two items (including expiration) will invalidate the two profiles.

My guess based on the error message is that you simply haven’t downloaded them to your machine. APT can do that for you as well as Xcode.

APT reports no errors when running Diagnostics on the app. So it seems all pieces are in place.

1 Like

When you build and get an error in Xojo, did you still get an app? If so, use the APT Package > Build feature to sign the app.

Keep in mind… ad-hoc requires a different kind of signing certificate than App Store. You need to make sure you have the right one. Also, Xojo doesn’t do ad-hoc signing for distribution to your team. You’ll need to use APT for that.

I do still get an app, and when I try to Package it with APT, I get an error:
The operation could’t be completed. (Cocoa error 70.)
So it’s having problems writing to file?

Let’s finish this up on the private thread we’re communicating on and then once we find the problem, we’ll post it here.

Please stop recommending this. Everyone I have helped who has had certificate problems got them from downloading from the Apple website instead of xCode. Xojo users, because of their understanding of key pairs, have more success downloading within xCode.

So much so that its a common circle of topics here.

3 Likes

Finally some success. Using Xojo 2024R4.1 I was able to create a package for the AppStore. One of the profiles had a reference to a certificate that no longer existed because it had been invalidated. Using the excellent APT tool I was able to remove all invalid certificates and profiles. The reason I struggled is that when you remove a profile using APT, it asks if you also want to remove the linked certificate. If that certificate does not exist (as was the case for me) the profile isn’t deleted either. By choosing “No” to the question if the Certificate also had to be removed, the invalid profile was removed correctly. I highly recommend using APT when you run into code signing issues for iOS. Another thing that helped me is using a unique name that you recognize for each certificate and profile, so that when an error references a certificate or profile, you know which one exactly is causing the issue. Finally, I hope that the Xojo documentation does get updated, as it is quite a few years old now.

2 Likes

Sorry for the misunderstanding, but we were talking about Profiles, not certificates… so, yes, my recommendation is to download these from the Apple Developer website. Thank you for sharing your recommendations @Tim_Parnell

Ah, my mistake. I’m sorry I misunderstood. I’m trying to determine where people are getting the idea so we can correct the source.

Personally I don’t suggest downloading profiles that way either. When Xcode gets them, they are named based on their internal GUID. APT does this too for compatibility. When you download profiles and double-click, the file gets copied as-is and you run the risk of having two that are identical, and codesign sometimes fails with an error about ambiguity.

3 Likes

Sorry @Greg_O , but I have to disagree with this.

When the profile is downloaded and you double-click on it, it is installed by Xcode using its internal UUID as the “installed profile name” under Library > Developer > Xcode > User Data > Provisioning Profiles; so no risk to install duplicates… instead it will overwrite / replace the existing one (if any).

As I said, that hasn’t always been my experience. YMMV

So let’s circle around to why recommend a possibly confusing method when there’s a one click install and Xcode is required to use Xojo iOS anyway?

@Tim_Parnell, is not confusing… and it is how it works… even better than just “manually downloading” all the existing profiles from Xcode (even when / if you don’t need them all on an especific comptuer). Downloading + double-clicking yourself offers more control about the iOS profiles installed.

As Greg said, that’s in my experience YMMV

Just test it yourself, please.

You’ll need to take that up with Xojo’s new target audience who routinely have problems with certificates. I’ll ping you next time so you can step up and answer. I was just trying to solve a very common problem we have here on the forum.

1 Like

Once again, we are talking about Provisioning Profiles here. Sorry to repeat myself, @Tim_Parnell