aws-sdk-ios icon indicating copy to clipboard operation
aws-sdk-ios copied to clipboard

Not possible to compile the iOS AWS SDK AppClip using iOS14.

Open Algalish opened this issue 4 years ago • 11 comments

Describe the bug I am trying to build the AppClip target using iOS14. But the moment I add AWS SDK pods to the target I get this problem: To Reproduce Steps to reproduce the behavior:

  1. Install 'Xcode Version 12.0 beta 6 (12A8189n)' (or any previous beta versions 1-5)
  2. Create empty iOS app
  3. Add 'AppClip target'
  4. Install '1.10.0.beta.2 version of CocoaPods' (because you can't build AppClips on a stable version of CocoaPods)
  5. Install AWS pods by using this Podfile
platform :ios, '14.0'

def aws_pods

pod 'AWSCore'
pod 'AWSAuthCore'
pod 'AWSS3'
pod 'AWSCognito'
pod 'AWSCognitoIdentityProvider'
pod 'AWSLambda'
pod 'AWSUserPoolsSignIn'

end
target 'testAppClip' do
 use_frameworks!
 aws_pods
end

target 'testAppClipClip' do
 use_modular_headers!
 aws_pods
end
  1. Try to build the empty app

Getting error at linking stage.

Link AWSUserPoolsSignIn (arm64)

Showing All Messages
Ld /Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Products/Debug-iphoneos/AWSUserPoolsSignIn-framework/AWSUserPoolsSignIn.framework/AWSUserPoolsSignIn normal (in target 'AWSUserPoolsSignIn-framework' from project 'Pods')
    cd /Users/USER/Downloads/testAppClip/testAppClip/Pods
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios8.0 -dynamiclib -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk -L/Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Products/Debug-iphoneos/AWSUserPoolsSignIn-framework -F/Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Products/Debug-iphoneos/AWSUserPoolsSignIn-framework -F/Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Products/Debug-iphoneos/AWSAuthCore-framework -F/Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Products/Debug-iphoneos/AWSCognitoIdentityProvider-framework -F/Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Products/Debug-iphoneos/AWSCognitoIdentityProviderASF-framework -F/Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Products/Debug-iphoneos/AWSCore-framework -filelist /Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/AWSUserPoolsSignIn-framework.build/Objects-normal/arm64/AWSUserPoolsSignIn.LinkFileList -install_name @rpath/AWSUserPoolsSignIn.framework/AWSUserPoolsSignIn -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/AWSUserPoolsSignIn-framework.build/Objects-normal/arm64/AWSUserPoolsSignIn_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -framework AWSAuthCore -framework AWSCognitoIdentityProvider -framework Foundation -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/AWSUserPoolsSignIn-framework.build/Objects-normal/arm64/AWSUserPoolsSignIn_dependency_info.dat -o /Users/USER/Library/Developer/Xcode/DerivedData/testAppClip-bjblqohlzvqbbnbwgiadkfzaawxf/Build/Products/Debug-iphoneos/AWSUserPoolsSignIn-framework/AWSUserPoolsSignIn.framework/AWSUserPoolsSignIn

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_AWSTask", referenced from:
      objc-class-ref in AWSCognitoUserPoolsSignInProvider.o
  "_OBJC_CLASS_$_AWSDDLog", referenced from:
      objc-class-ref in AWSUserPoolSignUpViewController.o
      objc-class-ref in AWSUserPoolsUIOperations.o
  "_OBJC_CLASS_$_AWSServiceConfiguration", referenced from:
      objc-class-ref in AWSCognitoUserPoolsSignInProvider.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Expected Behavior The app should build and run without problems

Unique Configuration If you are reporting an issue with a unique configuration or where configuration can make a difference in code execution (i.e. Cognito) please provide your configuration. Please make sure to obfuscate sensitive information from the configuration before posting.

Environment(please complete the following information):

  • SDK Version: 2.15.2
  • Dependency Manager: Cocoapods 1.10.0.beta.2
  • Swift Version : Objective-C code. (but the same works for Swift 4.0 or 5.0)
  • Xcode Version: Version 12.0 beta 6 (12A8189n)

Device Information (please complete the following information):

  • Device: iPhone XS Max
  • iOS Version: iOS 14.0 beta 6

Algalish avatar Aug 28 '20 12:08 Algalish

The moment I remove the 'AWSUserPoolsSignIn' pod - the empty targets is built without problems

Algalish avatar Aug 28 '20 12:08 Algalish

Currently, the AWS SDK for iOS is only supported for iOS apps, not extensions, app clips, or widgets. I'll flag this as a feature request and we'll update this when we have more information, but I don't currently have any progress to report on this.

palpatim avatar Aug 28 '20 14:08 palpatim

@palpatim Would it be possible to get some clarity on "AWS SDK for iOS is only supported for iOS apps, not extensions, app clips, or widgets?" What exactly is not supported? Is it just UI elements or is it the entirety of the authentication workflow? That is a major concern to me going forward because widgets and app clips are part of our roadmap in the very near future. At the very least I want to +1 the need for Cognito to support these.

corey-plugshare avatar Sep 18 '20 21:09 corey-plugshare

@corey-plugshare @palpatim I was able to make it work in the end. And unfortunately not sure what happened - after cleaning Derived Data folder and the project itself and re-installing pods - the app was built successfully. There is a however a restriction in size for AppClip for 10mb. So fitting all Amazon pods into the AppClip would be a problem. But Core+Lambda+Cognito + your own code + some of the other libs that you can use : works fine.

Algalish avatar Sep 19 '20 06:09 Algalish

Reopening this feature request to allow folks to continue to vote on it.

palpatim avatar Dec 07 '20 17:12 palpatim

Now that iOS 14.3 is out this seems more appropriate than ever

michaelbrewer avatar Dec 18 '20 17:12 michaelbrewer

@palpatim @michaelbrewer I actually made it work and added support for Cognito and Lambda into the AppClip. S3 however was too big to add there(due to AppClip limit) so I used another way to get files from S3. And I cannot say what exactly I did after it all started working: I spent a lot of time and refactored a lot of code inside the app and disabled some things. But I can definetly say that you can use Amazon SDK with AppClip, 100%

Algalish avatar Dec 18 '20 18:12 Algalish

I don't understand how this is not available in macOS as well... We are moving towards cross-platform, when we build an app it's not only for web or mobile but for desktop as well., is there any ETA?

afern247 avatar Feb 11 '21 21:02 afern247

I actually made it work and added support for Cognito and Lambda into the AppClip. S3 however was too big to add there(due to AppClip limit) so I used another way to get files from S3. And I cannot say what exactly I did after it all started working: I spent a lot of time and refactored a lot of code inside the app and disabled some things. But I can definetly say that you can use Amazon SDK with AppClip, 100%

@Algalish Could you explain how you got the files from S3 without including the S3 library?

cosimtaiuz avatar Jun 09 '21 23:06 cosimtaiuz

I actually made it work and added support for Cognito and Lambda into the AppClip. S3 however was too big to add there(due to AppClip limit) so I used another way to get files from S3. And I cannot say what exactly I did after it all started working: I spent a lot of time and refactored a lot of code inside the app and disabled some things. But I can definetly say that you can use Amazon SDK with AppClip, 100%

@Algalish Could you explain how you got the files from S3 without including the S3 library?

How did you make it work? I need to use Auth in extension. I notice a few people here say they made it work but without explaining how.

alionthego avatar Nov 20 '21 06:11 alionthego

Currently, the AWS SDK for iOS is only supported for iOS apps, not extensions, app clips, or widgets. I'll flag this as a feature request and we'll update this when we have more information, but I don't currently have any progress to report on this.

Is this still true?

It seems like the SDK is split up enough but each one is rather heavy for an App Clip.

Currently I'm only needing the Auth portion. It seems like that and the base 'Amplify' library take up around 4-5MB uncompressed. I've checked out the older general AWS SDK and it is smaller (~2MB). Is the older sdk still going to be supported into the future? Can I just get an unauthenticated jwt from rest calls without an sdk?

mevdev avatar Sep 16 '22 00:09 mevdev

Hello, jumping into this discussion even if the ticket is stale. Is the AWS SDK available in app extensions?

I would like to send an Analytics event from the NotificationAppExtension, basically we want to track when a notification is received on the app side.

Thanks!

dandreiolteanu avatar Nov 07 '23 13:11 dandreiolteanu

The AWS SDK for iOS doesn't support app extensions. We recommend using Amplify Swift for this -- for more information, please visit https://docs.amplify.aws/swift/

Thanks!

atierian avatar Dec 06 '23 22:12 atierian