Archive fails for watchOS framework
I'm currently trying to archive my watchOS framework (watchOS 7.4) that uses the GRDB static library. (Integrated via SPM)
Archive command:
xcodebuild archive -scheme $PROJECT_NAME -sdk watchos -archivePath "archives/ios_devices.xcarchive" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO | xcpretty
The archive fails with the following errors:
❌ /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/GRDB.build/Production-watchos/GRDB.build/Objects-normal/arm64/GRDB.swiftinterface:12:8: no such module 'GRDBSQLite'
❌ ld: file cannot be open()ed, errno=2 path=/Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/BuildProductsPath/Production-watchos/GRDB.o in '/Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/BuildProductsPath/Production-watchos/GRDB.o'
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
▸ Linking WatchSDK
❌ ld: file not found: /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/BuildProductsPath/Production-watchos/GRDB.o
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
▸ Linking WatchSDK
❌ ld: file cannot be open()ed, errno=2 path=/Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/BuildProductsPath/Production-watchos/GRDB.o in '/Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/BuildProductsPath/Production-watchos/GRDB.o'
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
The following build commands failed:
SwiftVerifyEmittedModuleInterface normal arm64 Verifying\ emitted\ module\ interface\ GRDB.swiftinterface /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/GRDB.build/Production-watchos/GRDB.build/Objects-normal/arm64/GRDB.swiftinterface (in target 'GRDB' from project 'GRDB')
SwiftVerifyEmittedModuleInterface normal arm64 Verifying\ emitted\ module\ interface\ GRDB.private.swiftinterface /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/GRDB.build/Production-watchos/GRDB.build/Objects-normal/arm64/GRDB.private.swiftinterface (in target 'GRDB' from project 'GRDB')
SwiftVerifyEmittedModuleInterface normal armv7k Verifying\ emitted\ module\ interface\ GRDB.swiftinterface /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/GRDB.build/Production-watchos/GRDB.build/Objects-normal/armv7k/GRDB.swiftinterface (in target 'GRDB' from project 'GRDB')
SwiftVerifyEmittedModuleInterface normal armv7k Verifying\ emitted\ module\ interface\ GRDB.private.swiftinterface /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/GRDB.build/Production-watchos/GRDB.build/Objects-normal/armv7k/GRDB.private.swiftinterface (in target 'GRDB' from project 'GRDB')
SwiftVerifyEmittedModuleInterface normal arm64_32 Verifying\ emitted\ module\ interface\ GRDB.private.swiftinterface /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/GRDB.build/Production-watchos/GRDB.build/Objects-normal/arm64_32/GRDB.private.swiftinterface (in target 'GRDB' from project 'GRDB')
SwiftVerifyEmittedModuleInterface normal arm64_32 Verifying\ emitted\ module\ interface\ GRDB.swiftinterface /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/GRDB.build/Production-watchos/GRDB.build/Objects-normal/arm64_32/GRDB.swiftinterface (in target 'GRDB' from project 'GRDB')
Ld /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/SDK.build/Production-watchos/WatchSDK.build/Objects-normal/arm64/Binary/WatchSDK normal arm64 (in target 'WatchSDK' from project 'SDK')
Ld /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/SDK.build/Production-watchos/WatchSDK.build/Objects-normal/armv7k/Binary/WatchSDK normal armv7k (in target 'WatchSDK' from project 'SDK')
Ld /Users/user/Library/Developer/Xcode/DerivedData/SDK-artnrqluokcqtjglhehcaaywwymm/Build/Intermediates.noindex/ArchiveIntermediates/WatchSDK/IntermediateBuildFilesPath/SDK.build/Production-watchos/WatchSDK.build/Objects-normal/arm64_32/Binary/WatchSDK normal arm64_32 (in target 'WatchSDK' from project 'SDK')
I appreciate the help!
Hello @patrickniepel,
Thank you for the report. It's been a long time I haven't archived a watchOS app. I'll have a look, but please first answer a few questions that you ignored when you were presented the issue submission form (please do not ignore issue submission forms from now on):
- Which GRDB version are you using? Is it through SPM or another technique?
- Which Xcode version are your using?
- Is it a regression (something that used to work and stopped working at some point)?
Thanks for responding, won't happen again :)
- I'm using the most recent version
v7.6.1, integrated via SPM - Xcode
16.4 - It's not a regression. This is the first time I'm using GRDB
@groue did you have time to look into this or do you maybe have an idea how we could work around this? 🙂