I am encountering an issue when trying to create an xcframework that includes Amplify code using xcodebuild archive. Unfortunately, the process results in an error and the archive fails. I'm hoping to get some guidance or suggestions from the community on how to resolve this problem.
Code Implementation:
I am working with a simple codebase that is primarily aimed at testing the feasibility of creating an xcframework that includes Amplify. In my code, I import Amplify with @_implementationOnly
xcodebuild Details:
xcodebuild archive \
-project TestFramework/TestFramework.xcodeproj \
-scheme TestFramework \
-destination "generic/platform=iOS" \
-archivePath output/TestFramework \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
Error Details:
SwiftCompile normal arm64 Compiling Amplify.swift, ... (in target 'Amplify' from project 'Amplify')
CompileSwift normal x86_64 (in target 'Amplify' from project 'Amplify')
(2 failures)`
These two errors come from:
/Users/xxx/Library/Developer/Xcode/DerivedData/TestFramework-gdmxagaxhvbtyiawiqcvxktucpod/SourcePackages/checkouts/amplify-swift/Amplify/Categories/DataStore/Model/Temporal/SpecBasedDateConverting.swift:23:14: error: 'let' property 'convert' may not be initialized directly; use "self.init(...)" or "self = ..." instead
self.convert = converter
Environment:
Xcode version: 15.0.1
Amplify version: 2.10.0
Swift version: 5.9
Operating system: Ventura 13.6.2
I would greatly appreciate any advice, workarounds, or solutions that anyone can offer. Thank you in advance for your assistance!