We have a Mac mini running our CI with Xcode 16, and empty accounts seem to appear in it as time goes by. I haven't yet isolated which job(s) are triggering this, it slows builds down considerably, especially because any code-signing related task yields a ton of error messages like
IDEDistribution: Failed to log in with account "(null)" while checking for an App Store Connect account (Error Domain=DVTServicesAccountBasedSessionErrorDomain Code=0 "Unable to log in with account 'mobile-devs@sightcall.com'." UserInfo={NSLocalizedFailureReason=Unable to log in with account 'mobile-devs@sightcall.com'., NSLocalizedRecoverySuggestion=The login details for account 'mobile-devs@sightcall.com' were rejected., DVTDeveloperAccountErrorAccount=<DVTAppleIDBasedDeveloperAccount: 0x60000169c900; username='mobile-devs@sightcall.com'>, NSUnderlyingError=0x600001e71f50
This is obviously an Xcode bug, but has anyone found a work-around somehow ?
Post
Replies
Boosts
Views
Activity
Hi,
We have a series of apps all configured with Xcode managed signing. The only difference between them, except their code, is the build ID. In our CI, one app builds and exports without errors, while all the others fail. Authentication is done through keyID/keyFile/keyIssuerID triplet, but the Xcode installation on the CI machine has a bunch of those empty accounts in it as mentioned in this thread https://forums.developer.apple.com/forums/thread/764554.
Looking at the xcodebuild archive logs, I have this for the "working" app :
Default = "<_IDEProvisionableConfigurationSnapshot ✉️: name: Default, provisioningStyle: 0, certificateSigningStyle: 2, team: <IDEProvisioningBasicTeam: ✉️; teamID='<TEAMID>', teamName='MYTEAM'>, profileSupport: <IDEProvisioningProfileSupport: ✉️>, platform: <DVTPlatform:✉️:'com.apple.platform.iphoneos':<DVTFilePath:✉️:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform'>>, sdk: (null), sdkVariant: (null), bundleIdentifier: livetranslation.LiveTranslation, profileSpecifier: (null), certificateIdentifier: iPhone Distribution, entitlementsFilePath: (null), baseEntitlements: <IDEProvisionableEntitlements: ✉️; signedEntitlements='{\n}', simulatedEntitlements='(null)'>, entitlementsExpansion: <IDEDistributionProvisioningEntitlementsExpansion: ✉️>, entitlementsDestination: 1, allowSigningWithoutTeamSelection: 0, signingRequiresTeam: 0, appIDFeatures: <DVTPortalAppIDFeatures ✉️: Features: {\n}, Containers: {\n}>, provisioningPurpose: app-store, supportsIOSMac: 0>";
}, overrides: <IDEProvisionableOverrides ✉️: configuration: Default, profileSupport: <IDEProvisioningProfileSupport: ✉️>, provisioningStyle: (null), certificateSigningStyle: (null), provisioningPurpose: app-store, team: (null), platform: <DVTPlatform:✉️:'com.apple.platform.iphoneos':<DVTFilePath:✉️:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform'>>, sdk: (null), sdkVariant: (null), profileSpecifier: (null), certificateIdentifier: (null), bundleIdentifier: (null), entitlements: (null), entitlementsFile: (null), baseEntitlements: (null), entitlementsExpansion: (null), entitlementsDestination: (null), allowSigningWithoutTeamSelection: (null), signingRequiresTeam: (null), appIDFeatures: (null)>>>, configuration: Default, codesignParameterSnapshot: <IDECodesignParameterSnapshot: ✉️>:
Identity: E1A91D4C347F60D4E8EFFAD9C8F2493AB99DFAFA
Certificate <DVTSigningCertificate: ✉️; name='Apple Distribution: MYTEAM (TEAMID)', hash='E1A91D4C347F60D4E8EFFAD9C8F2493AB99DFAFA', serialNumber='1AE77EDC19294212C6AE6D5DC550D66C', certificateKinds='(
"1.2.840.113635.100.6.1.7",
"1.2.840.113635.100.6.1.4"
), issueDate='🕙''>>, errors: (null)>
and this for the apps failing to sign :
🕙 [MT] Step failed: <IDEDistributionSigningAssetsStep: ✉️>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionUnderlyingErrors=(
"Error Domain=DeveloperAPIServiceErrorDomain Code=5 \"Cloud signing permission error\" UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedRecoverySuggestion=You haven't been given access to cloud-managed distribution certificates. Please contact your team's Account Holder or an Admin to give you access. If you need further assistance, contact Apple Developer Program Support at https://developer.apple.com/contact/., NSLocalizedDescription=Cloud signing permission error}",
"Error Domain=IDEProfileLocatorErrorDomain Code=1 \"No profiles for 'com.myteam.myapp' were found\" UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=No profiles for 'com.myteam.myapp' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store provisioning profiles matching 'com.myteam.myapp'.}"
)}
I've checked that the ID used to authenticate has cloud signing permissions (it obviously has them since it's working for one app). So what could be the problem here ?
Hello,
We are using automatic signing for a couple of projects, and we're struggling to get it to work in a CI with Xcode 16. It was working with Xcode 15 but with Xcode 16 we get the following errors :
error: The operation couldn’t be completed. Unable to log in with account ''. The login details for account '' were rejected.
error: Provisioning profile "iOS Team Provisioning Profile: com.bundleid.my" doesn't include signing certificate "Apple Development: Foobar (TEAMID)".
Any ideas ?
This post is meant to provide useful information on how to build a set of xcframeworks from a hierarchy of Swift Packages containing a mix of ObjC and Swift. If you only want to build a single xcframework from a Swift Package, as this is not obvious either, you should find some useful info too.
Stuff that needs to be done for building an XCFramework from a Swift Package through xcodebuild
set library type to .dynamic in Package.swift
set SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES OTHER_SWIFT_FLAGS="-no-verify-emitted-module-interface" in xcodebuild command
no need to use 'archive' xcodebuild command, xcodebuild alone is enough
In generated framework :
copy public headers (in case of ObjC package)
copy (or create) module.modulemap file, or copy .swiftmodule file
copy umbrella header FooPackage-Swift.h from derived data (use -derivedDataPath xcodebuild option to retrieve it) in case of Swift Package, otherwise won't be useable from ObjC
copy resource bundle (if any)
In many cases I found that people are using xcodebuild archive for this task, but I find that not necessary. The archive doesn't contain anything more than what you get from xcodebuild only.
Here's the script I ended up writing : build_xcframework_from_swift_package.sh
Setup
A set of Swift Packages, containing Swift and ObjC code, with dependencies. We need to use these Packages in an app and also to create XCFrameworks from them.
The (simplified) dependencies are as follows :
CommonObjC <- Common <- Package1, Package2... <- GlobalPackage <- MainApp
Problems encountered, and their solutions
Many of these problems come from the fact that we need to use these modules both as Swift Packages and as XCFrameworks.
xcodebuild needs the library defined in the Swift Package to be explicitly declared of type .dynamic, otherwise only a .o is generated for a package
But if all libs are dynamic, then, in the Swift Package usecase, symbols in CommonObjC won't be visible from MainApp. If CommonObjC is explicitly added to MainApp's linked frameworks, Xcode issues a build error saying "CommonObjC is linked as a static library but cannot be built dynamically because there is a package product with the same name".
Solution : since we don't want libs to be dynamic for the case where the Swift Packages are used directly, have the library type set depending on a Environment var. There doesn't seem to be a way to pass Swift Compiler flags (-DFOO) to xcodebuild so that they are used when evaluating a Package.swift file.
This works :
func runtimeLibType() -> Product.Library.LibraryType?
{
return ProcessInfo.processInfo.environment["SPM_GENERATE_FRAMEWORK"] != nil ? .dynamic : nil
}
and then
let package = Package(
name: "FooPackage",
products: [
.library(
name: "FooPackage",
type: runtimeLibType(),
targets: ["FooPackage"]),
],
...
Symbols from a package Foo's dependency are not visible from another package or app using package Foo.
If Package Foo is in Swift, the solution is to use '@_exported' in the import statement for the dependency :
PackageFoo/SomeFile.swift :
@_exported import Dependency
then in App :
import PackageFoo
-> symbols from Dependency will be visible.
There is no equivalent solution in ObjC
Symbol export issues with "composed" package (ie a package built from two targets)
Solution is simply to not do that. Stick to one package being built from one target.
Importing a 2nd-level dependency in a public header works when building from SPM, but not when an app is importing the resulting xcframework (dependencies are not transient in this case)
For instance :
PackageRT depends on PackageCore which depends on PackageCoreObjC
PackageRT/include/public_header.h can '@import' PackageCoreObjC. It works as long as you build from SPM, but when you build PackageRT into an xcframework, importing the resulting xcframework will fail because the @import PackageCoreObjC in PackageRT/include/public_header.h fails because PackageCoreObjC module is not found.
Solution is to explicitly add PackageCoreObjC as a dependency to PackageRT.
We have a set of Swift Packages with dependencies from one to another, and we need to build xcframeworks out of those. We currently iterate over each package and xcodebuild archives out of them, but this is really slow. It also seems that the dependencies are rebuilt for every package, and we're looking for a way to avoid that.
More precisely, say we have the following packages
CoreFoundation
Feature1, depending on CoreFoundation
We need to turn this into corefoundation.xcframework and feature1.xcframework. The problem is that when calling xcodebuild on Feature1, it seems to be rebuilding CoreFoundation even though it's already been built when building corefoundation.xcframework.
Anyone knows of a better way to do that ? Lumping it all together in a single xcframework doesn't seem to be possible.
Thanks for any input :)
I have a simple CloudKit query over a given record type, with a sort descriptor for one of the attribute, which is of type String, and the results come out in the wrong order. This is even visible in the CloudKit console (see screenshot, ordering is by title). Can anyone explains what happens here ? I've checked that there wasn't any weird characters in the attributes.
Thanks.
Hi all,I'm working on an app which relies on Data Protection to, well, protect the user's data from being accessed externally. We need to validate the encryption of the data, so we'd like to see the sqlite file in its encrypted state. However, if we download the app's container from Xcode, we get a regular sqlite file with all data in clear. We tried to get the same sqlite file throught iExplorer while the app is not running, and in this case we get a file of the same size, which sqlite3 can open correctly, but on which all queries do not return anything. Checking the file's contents with /usr/bin/strings shows that while the table names and schema is still visible, the actual data content is not.This looks ok but we'd rather make sure that we're not missing something and that the file is actually encrypted in its "normal" state. How can we check that ?
I'm currently working on an app which requires Full Disk Access. Exporting the app as a bundle, copying it to /Applications and giving it Full Disk Access privilege works fine, but I can't find a way to run it in Xcode with those privileges. I tried adding the bundle generated in Xcode's Derived Data folder, but that doesn't help, the app is still denied access when I launch it from Xcode. So how am I supposed to do this ?