#✅ - Issue with xcodebuild archive When Creating xcframework with Amplify

5 messages · Page 1 of 1 (latest)

celest compass
#

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!

latent fiber
#

Hey @celest compass, thanks for the question. There's some relevant information in this GitHub issue that should help: https://github.com/aws-amplify/amplify-swift/issues/2001#issuecomment-1194255619

Let us know if you have any follow up questions. Thanks!

GitHub

Describe the bug It's impossible to archive my iOS framework in command line when I use Amplify To Reproduce install Amplify, AmplifyPlugins/AWSAPIPlugin and AmplifyPlugins/AWSCognitoAuthPlugin...

celest compass
# latent fiber Hey <@801459999507218452>, thanks for the question. There's some relevant inform...

Thank you for your response.

I've checked this issue and your comments. Could you possibly provide a sample or example on how to implement the following?

Make an intermediate wrapper framework that wraps Amplify, importing it using @_implementationOnly, so the wrapper doesn't publicly expose Amplify's ABI. e.g., @_implementationOnly import Amplify.

Also, we were considering using Cognito through Amplify for our framework, but if we're focusing on XCFramework, should we use it from the aws-ios-sdk instead?

real gale
waxen starBOT
#

✅ - Issue with xcodebuild archive When Creating xcframework with Amplify