Archive Build failed " Command SetOwnerAndGroup failed with a nonzero exit code" in Xcode 14

According to the WWDC202310224 "Simplify distribution in Xcode and Xcode Cloud" video, there are two questions about my development process.

First, the developer must use "Development Profile" to config Signing & Capability instead of "Developer ID Application profile" for building Applications?

shown as the pictures below

Second, after build application successfully with "Development Profile", process Product -> archive will fail with "Command SetOwnerAndGroup failed with a nonzero exit code" error message, I have no idea how to solve this problem. Cloud you please tell me how to successfully archive the DriverKit application step by step and further directly distribute Application ?

Thanks for your helpful support.

First, the developer must use "Development Profile" to config Signing & Capability instead of "Developer ID Application profile" for building Applications?

My general recommendation is that you use an Apple Development signing identity for day-to-day development, reserving Developer ID for your final distribution. See The Care and Feeding of Developer ID.

after build application successfully with "Development Profile", process Product -> Archive will fail with "Command SetOwnerAndGroup failed with a nonzero exit code" error message

I think the problem here is that you’re building to within a directory on your desktop. The desktop is protected by MAC, and that can cause all sorts of weird problems. Move your build directory somewhere that’s not MAC protected. I usually do this sort of work in a new directory that I create within my home directory.

For more info about MAC, see On File System Permissions.

If you want to maintain easy access to that directory, create an alias on your desktop that points to that directory.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@eskimo Thanks for your reply

I think the problem here is that you’re building to within a directory on your desktop. The desktop is protected by MAC, and that can cause all sorts of weird problems. Move your build directory somewhere that’s not MAC protected. I usually do this sort of work in a new directory that I create within my home directory.

For more info about MAC, see On File System Permissions. If you want to maintain easy access to that directory, create an alias on your desktop that points to that directory. I have totally no idea which directory is not protected by MAC, I've tried so many directory such like ~/Application and search apple document to realize that where is the best directory to place whole project.

Cloud you please tell me where can place whole project to archive successfully?

And, I also tried another ways to archive my project to distribute. I use two types of "xcodebuild" command to archive project but both of them have a similar problem. There are two type of commands below:

  1. xcodebuild -project USBApp.xcodeproj -scheme AX88179 -archivePath "AX88179.xcarchive" DWARF_DSYM_FOLDER_PATH="build" -targetgeneral/platform=macos archive

  2. xcodebuild -alltargets archive

  3. error code is :

"SetOwnerAndGroup root:wheel /Users/asix/Desktop/Dext2.2.0commandtest/Build/Intermediates.noindex/ArchiveIntermediates/AX88179/IntermediateBuildFilesPath/UninstalledProducts/driverkit/com.asix.development.driverkit.dext (in target 'AX88179' from project 'USBApp') cd /Users/asix/Desktop/Dext2.2.0commandtest /usr/sbin/chown -RH root:wheel /Users/asix/Desktop/Dext2.2.0commandtest/Build/Intermediates.noindex/ArchiveIntermediates/AX88179/IntermediateBuildFilesPath/UninstalledProducts/driverkit/com.asix.development.driverkit.dext chown: /Users/asix/Desktop/Dext2.2.0commandtest/Build/Intermediates.noindex/ArchiveIntermediates/AX88179/IntermediateBuildFilesPath/UninstalledProducts/driverkit/com.asix.development.driverkit.dext/com.asix.development.driverkit: Operation not permitted chown: /Users/asix/Desktop/Dext2.2.0commandtest/Build/Intermediates.noindex/ArchiveIntermediates/AX88179/IntermediateBuildFilesPath/UninstalledProducts/driverkit/com.asix.development.driverkit.dext/embedded.provisionprofile: Operation not permitted chown: /Users/asix/Desktop/Dext2.2.0commandtest/Build/Intermediates.noindex/ArchiveIntermediates/AX88179/IntermediateBuildFilesPath/UninstalledProducts/driverkit/com.asix.development.driverkit.dext/Info.plist: Operation not permitted chown: /Users/asix/Desktop/Dext2.2.0commandtest/Build/Intermediates.noindex/ArchiveIntermediates/AX88179/IntermediateBuildFilesPath/UninstalledProducts/driverkit/com.asix.development.driverkit.dext: Operation not permitted Command SetOwnerAndGroup failed with a nonzero exit code

** ARCHIVE FAILED **"

  1. error code is:

"Create build description Command failed with a nonzero exit code

error: unexpected service error: build aborted due to an internal error: unable to write manifest to '/Users/asix/Desktop/Dext2.2.0commandtest/build/XCBuildData/d004680d06c003af166da503c1228bc3.xcbuilddata/manifest.json': mkdir(/Users/asix/Desktop/Dext2.2.0commandtest/build/XCBuildData/d004680d06c003af166da503c1228bc3.xcbuilddata, S_IRWXU | S_IRWXG | S_IRWXO): Permission denied (13) ** ARCHIVE FAILED **"

If I add "sudo" into the top of both of command above, It'll show "note: Building targets in dependency order /Users/asix/Desktop/Dext2.2.0commandtest/USBApp.xcodeproj: error: No profile for team '5RHFAZ9D4P' matching 'Development Driverkit profile' found: Xcode couldn't find any provisioning profiles matching '5RHFAZ9D4P/Development Driverkit profile'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the Signing & Capabilities tab of the target editor. (in target 'AX88179' from project 'USBApp') /Users/asix/Desktop/Dext2.2.0commandtest/USBApp.xcodeproj: error: No profile for team '5RHFAZ9D4P' matching 'Development product' found: Xcode couldn't find any provisioning profiles matching '5RHFAZ9D4P/Development product'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the Signing & Capabilities tab of the target editor. (in target 'USBApp' from project 'USBApp') ** ARCHIVE FAILED **" error code .

The error code above, could you please tell me as detail as you can that how to solve those problem no matter use Xcode IDE or Commands? I tried so many ways passing the archive process.....

According to the "Simplify distribution in Xcode and Xcode Cloud" introduction video, distribute Driverkit application needs to use Profile type "Development" to config "signing & capability" and pass the archive to notarize project to organizer, later to distribute. Do I have any misunderstanding of the process to distribute the Driverkit application?

I really needs some specific methods or suggestions to distribute my Driverkit application. It's fine to tell me another brand new distribute process detail if totally misunderstanding the whole process.

Thanks for your help

Sincerely.

please tell me where can place whole project to archive successfully?

I did that in my previous post:

I usually do this sort of work in a new directory that I create within my home directory.

The name of that directory shouldn’t matter [1]. For example, I have ~/Programming for general programming and ~/Packages for my Swift package work.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Although to make your life easier you should stick to ASCII alphanumerics Myself, I do my bit to help the Xcode team find bugs in their build system by doing a lot of my work in a directory ~/DTS Work. You’d be amazed at how many bugs that single space character has uncovered over the years (-:

Accepted Answer

I had the "Command SetOwnerAndGroup failed with a nonzero exit code" problem when creating an Archive and fixed it by removing both the Install Group and Install Owner in the target build deployment settings.

Select the app in Targets, select Build Settings and All and Combined. Scroll down to the Deployment section and remove the entries for Install Group and Install Owner.

Had the same issue and solved by deleting derived data.

Archive Build failed " Command SetOwnerAndGroup failed with a nonzero exit code" in Xcode 14
 
 
Q