aws-amplify / aws-sdk-ios

AWS SDK for iOS. For more information, see our web site:
https://aws-amplify.github.io/docs
Other
1.68k stars 880 forks source link

AWSMobileClient not working in Xcode 12.2 #3252

Closed shekunsky closed 3 years ago

shekunsky commented 3 years ago

Hi! I downloaded the latest AWS IOS SDK ver 2.19.1 from the link https://sdk-for-ios.amazonwebservices.com/latest/aws-ios-sdk.zip But AWSMobileClient framework not compiled in Xcode 12.2 with error Module compiled with Swift 5.3 cannot be imported by the Swift 5.3.1 compiler: AWSMobileClient.framework/Modules/AWSMobileClient.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

royjit commented 3 years ago

As of 2.22.1, we distribute the AWSMobileClient binary as an XCFramework with the BUILD_LIBRARY_FOR_DISTRIBUTION flag enabled. Please see Carthage installation instructions or XCFramework installation instructions in the README for more info.

Do note that you will have to import a different module name; for backwards compatibility with CocoaPods users, we had to distribute the XCFramework binary under a different target. The usage at the call site remains the same:

YourAppCode.swift

import AWSMobileClientXCF // Note the new module name

// later, at the call site...
AWSMobileClient.default().initialize() { _ in print("AWSMobileClient initalized") }

Let us know if you have any questions. I am closing this issue, please reply back in here - https://github.com/aws-amplify/aws-sdk-ios/issues/3033, if you are facing any other issues.