I am trying to add a Mac command line tool target to an existing SwiftUI project, and use the swift-argument-parser framework in that command line tool.
I get build errors after adding the swift-argument-parser to my project.
Here are the minimum reproducible example steps that trigger this problem:
Create new Multiplatform app “Test”
File>New>Target macOS command line tool named “TestCmd”
Select Scheme “TestCmd” and verify that it runs successfully.
Select TestCmd target
File>Add Package dependencies>swift-argument-parser
Add both ArgumentParser and generate-manual packages to TestCmd target
Run from TestCmd scheme.
This yields a whole stream of errors:
Library not loaded:
@rpath/ArgumentParser.framework/Versions/A/ArgumentParser
Reason: tried:
‘/Library/Developer/Xcode/DerivedData/Test-hjtkgtqoywzwinaakrcdvgycyxhx/Build/Products/Debug/ArgumentParser.framework/Versions/A/ArgumentParser'
(no such file),
‘/Library/Developer/Xcode/DerivedData/Test-hjtkgtqoywzwinaakrcdvgycyxhx/Build/Products/Debug/PackageFrameworks/ArgumentParser.framework/Versions/A/ArgumentParser'
(code signature in <9CBB1F37-8A3F-32FC-9744-3108CEF0D6A5>
‘/Library/Developer/Xcode/DerivedData/Test-hjtkgtqoywzwinaakrcdvgycyxhx/Build/Products/Debug/PackageFrameworks/ArgumentParser.framework/Versions/A/ArgumentParser'
not valid for use in process: mapping process and mapped file
(non-platform) have different Team IDs),
'/Library/Developer/Xcode/DerivedData/Test-hjtkgtqoywzwinaakrcdvgycyxhx/Build/Products/Debug/PackageFrameworks/ArgumentParser.framework/Versions/A/ArgumentParser'
(code signature in <9CBB1F37-8A3F-32FC-9744-3108CEF0D6A5>
'/Library/Developer/Xcode/DerivedData/Test-hjtkgtqoywzwinaakrcdvgycyxhx/Build/Products/Debug/PackageFrameworks/ArgumentParser.framework/Versions/A/ArgumentParser'
not valid for use in process: mapping process and mapped file
(non-platform) have different Team IDs),
'/System/Volumes/Preboot/Cryptexes/OS/Library/Developer/Xcode/DerivedData/Test-hjtkgtqoywzwinaakrcdvgycyxhx/Build/Products/Debug/PackageFrameworks/ArgumentParser.framework/Versions/A/ArgumentParser'
(no such file),
'/Library/Developer/Xcode/DerivedData/Test-hjtkgtqoywzwinaakrcdvgycyxhx/Build/Products/Debug/PackageFrameworks/ArgumentParser.framework/Versions/A/ArgumentParser'
(code signature in <9CBB1F37-8A3F-32FC-9744-3108CEF0D6A5>
'/Library/Developer/Xcode/DerivedData/Test-hjtkgtqoywzwinaakrcdvgycyxhx/Build/Products/Debug/PackageFrameworks/ArgumentParser.framework/Versions/A/ArgumentParser'
not valid for use in process: mapping process and mapped file
(non-platform) have different Team IDs),
'/System/Volumes/Preboot/Cryptexes/OS~/Library/Developer/Xcode/DerivedData/Test-hjtkgtqoywzwinaakrcdvgycyxhx/Build/Products/Debug/PackageFrameworks/ArgumentParser.framework/Versions/A/ArgumentParser'
(no such file)
Searching on the string "not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs" yields some posts about signing a Mac product for distribution on Apple's developer forums.
I will eventually want to code sign the command line tool target so I can share it/distribute it on the App Store, but for now, I just want to develop the @#$@#$ command locally.
Question: How do I add the swift-argument-parser SPM package to my nascent command line tool so I can start writing my command?
I can upload the above minimum project to GitHub if it would be helpful, but it takes less than a minute to reproduce the errors above.
(I'm using Xcode 15.0, running on an M2 Mac with macOS Sonoma 14.0, if that matters.)
Post
Replies
Boosts
Views
Activity
What happens to an app when the enterprise provisioning profile that's it's built with expires?A client I'm working for wants to use their enterprise account to provide an app to their remote staff. These are BYOD devices, and they don't want to fully manage them, just install and maintain this app (and possibly others but for now just a sigle app.)Does the app stop working when the provisioning profile it's built with expires? If not, what does happen?If it does stop working, what's the best practice for getting an updated app into remote staff's hands prior to the expiry of the provisioning profile?And can we use MDM to simply deliver and update the enterprise app on remote staff's devices without taking over other aspects of managing their iDevices?About the only other thing we might want MDM for is managing proxy settings, and possibly setting up a VPN.