Aws-sdk-ios: Compatibility with XCode 8

Created on 29 Jun 2016  Â·  31Comments  Â·  Source: aws-amplify/aws-sdk-ios

I have a Swift project that pulled aws-sdk v2.4.4 from cocoapods. When compiling with XCode 8 (build 8S128d), the following error is seen.

image

question

Most helpful comment

same problem here , just updated to XCode 8, with Swift 2.3, using cocoapods AWSDynamoDB v.2.4.8, and I'm getting this build errors:

screen shot 2016-09-15 at 4 03 41 pm

All 31 comments

What service are you trying to use?

AWSCognito
AWSCognitoServiceProvider
AWSCore

I'm not able to reproduce the error on xcode 8, i'm using AWSCognito and AWSCore and i was able to run the sample app on iPhone SE. Can you give me some more information to reproduce this problem?

Your sample app is in ObjectiveC. My app is written in Swift. I pulled the SDK using Cocoapods. Before Xcode 8, it compiles nicely. In particular, the error points to the sqlite3.h header. Are there any complied flags that I need to set? Or any Cocoapods version I need to use? I understood that the xcconfig files generated could be different between 0.36 and 1.0 version of Cocoapods. Is there any baseline version?

I should have been more clearer, i created a new sample in swift for testing this and i was not able to reproduce the error

Here is an expanded capture:

image

image

@chriskan0305 Project library settings can sometimes get messed up when upgrading Cocoapods to v1.0 and at the same time mixing Objective-C and Swift. Do you see the same error message after the following cleanup?

  1. Clean Build -> ⇧⌘K (Shift + Command + K) - to clean builded frameworks.
  2. Clean Build Folder -> ⌥⇧⌘K (Option+Shift+Command+K)
  3. Close Xcode
  4. $ rm -rf ~/Library/Developer/Xcode/DerivedData
  5. $ pod update
  6. Open XCode and build

Tried using the pods in a new iMessage App project, and kept getting crashes saying the frameworks weren't loading.

dyld: Library not loaded: @rpath/AWSCore.framework/AWSCore
Referenced from: /Users/adamjohnson/Library/Developer/CoreSimulator/Devices/64B904E8-3D94-4772-8AC3-DE352E248B2A/data/Containers/Bundle/Application/B8749641-2560-413C-A374-08BDB2BB5EEA/TestMessageApp.app/PlugIns/MessagesExtension.appex/MessagesExtension
Reason: image not found

Steps to reproduce:

  1. Create new iMessage App.
  2. Create Podfile with pod 'AWSS3'
  3. pod install
  4. import AWSS3 in your MessagesViewController.swift file
  5. Build and Run.
  6. Swipe over to your iMessage app (if necessary).
  7. Crash.

Xcode 8.0 Beta 4 resolves this issue for me

Hi. I'm using Xcode 8 beta 5 and even if I clean everything and rebuild I still get the include error. I'm using AWSSQS in Swift.

If I include the SDK directly as a framework rather than through Cocoapods all works well, but I'd rather keep the pod if I can..

In project settings for AWSCore, I even have 'Allow nonmodular includes in Framework modules' turned on but I still get the error.

This error doesn't happen anymore as of Xcode 8 Beta 6 and Xcode 8 GM.

Ok, thanks!

Just migrated our Swift project from 2.2 to 3.0 using Xcode 8 GM and we are still getting this error.

An example project with this issue demonstrated. https://github.com/stdrovia/AWSSwift3Test

I'm also facing this issue.
Is there any update?

I get the same error, and I am using Cognito, S3 and dynamoDB. Project in Obj-C and XCode release version. Any news?

I might the same issue. I'm running Swift 2.3, with XCode 8 GM, using AWSS3 version 2.4.8 from pods.

Right now my project has a bunch of build errors.

.../Pods/AWSS3/AWSS3/AWSS3RequestRetryHandler.h:16:9: Include of non-modular header inside framework module 'AWSS3.AWSS3RequestRetryHandler'

.../Pods/AWSCore/AWSCore/Mantle/AWSMTLJSONAdapter.h:71:1: Duplicate interface definition for class 'AWSMTLJSONAdapter'
.../Pods/AWSCore/AWSCore/Mantle/AWSMTLJSONAdapter.h:75:77: Property has a previous declaration
.../Pods/AWSCore/AWSCore/Mantle/AWSMTLManagedObjectAdapter.h:191:1: Duplicate interface definition for class 'AWSMTLManagedObjectAdapter'
.../Pods/AWSCore/AWSCore/Mantle/AWSMTLModel.h:16:1: Duplicate interface definition for class 'AWSMTLModel'
.../Pods/AWSCore/AWSCore/Mantle/AWSMTLModel.h:55:53: Property has a previous declaration
.../Pods/AWSCore/AWSCore/Mantle/AWSMTLModel+NSCoding.h:23:5: Redefinition of enumerator 'AWSMTLModelEncodingBehaviorExcluded'
.../Pods/AWSCore/AWSCore/Mantle/AWSMTLModel+NSCoding.h:24:5: Redefinition of enumerator 'AWSMTLModelEncodingBehaviorUnconditional'
.../Pods/AWSCore/AWSCore/Mantle/AWSMTLModel+NSCoding.h:25:5: Redefinition of enumerator 'AWSMTLModelEncodingBehaviorConditional'
.../Pods/AWSCore/AWSCore/Mantle/AWSMTLModel+NSCoding.h:26:3: Typedef redefinition with different types ('enum AWSMTLModelEncodingBehavior' vs 'enum AWSMTLModelEncodingBehavior')
.../Pods/AWSCore/AWSCore/Mantle/AWSMTLValueTransformer.h:16:1: Duplicate interface definition for class 'AWSMTLValueTransformer'
.../Pods/AWSCore/AWSCore/Utility/AWSModel.h:18:1: Duplicate interface definition for class 'AWSModel'
.../Pods/AWSCore/AWSCore/Utility/AWSModel.h:22:1: Duplicate interface definition for class 'AWSModelUtility'
.../Pods/AWSCore/AWSCore/Networking/AWSNetworking.h:21:5: Redefinition of enumerator 'AWSNetworkingErrorUnknown'
.../Pods/AWSCore/AWSCore/Networking/AWSNetworking.h:22:5: Redefinition of enumerator 'AWSNetworkingErrorCancelled'
.../Pods/AWSCore/AWSCore/Networking/AWSNetworking.h:25:28: Redefinition of 'AWSNetworkingRetryType'
.../Pods/AWSCore/AWSCore/Networking/AWSNetworking.h:26:5: Redefinition of enumerator 'AWSNetworkingRetryTypeUnknown'
.../Pods/AWSCore/AWSCore/Networking/AWSNetworking.h:27:5: Redefinition of enumerator 'AWSNetworkingRetryTypeShouldNotRetry'

same problem here , just updated to XCode 8, with Swift 2.3, using cocoapods AWSDynamoDB v.2.4.8, and I'm getting this build errors:

screen shot 2016-09-15 at 4 03 41 pm

Also experiencing this issue. XCode 8, Swift 3. AWS SDK 2.4.8.

I'm also facing same issue,
Xcode 8.0GM,

Cocoapods
cocoapods (1.0.0)
cocoapods-core (1.0.0)
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.1)
cocoapods-plugins (1.0.0, 0.4.2)
cocoapods-search (1.0.0, 0.1.0)
cocoapods-stats (1.0.0, 0.6.2)
cocoapods-trunk (1.0.0, 0.6.4)
cocoapods-try (1.1.0, 0.5.1)

Podfile
Using AWSCore (2.4.8)
Using AWSS3 (2.4.8)

Having the same issue as chriskan0305

Same issue here, not working with version 2.4.7

I have the same issue. Xcode 8 and Swift 3.0, using AWSS3 and AWSCore 2.4.8

@karthiksaligrama the issue opened in June! How long should we wait until AWS-iOS-SDK supports Xcode 8? I tried everything, and I want to test the app on my device which is iOS10 and we need to launch soon. Please, please please we need this compatibility issue resolved!!
or please let me know if any simple way I can use AWS in our project?

I was able to fix this issue by updating cocoapods to version 1.0.1. If you're still having trouble after updating, try uninstalling cocoapods and then doing a fresh install.

AWS pods version 2.4.8 are now installing and working for me just fine using Xcode 8 with Swift 2.3

Edit: I had to drop down to version 2.4.7 for the pods otherwise I kept getting the same AWSURLRequestRetryHandler.h' file not found error.

Can confirm. I am using AWS SDK version 2.4.7 with Swift 2.3. No trouble at
all

On Sun, Sep 18, 2016 at 11:30 PM, Mitchell Porter [email protected]
wrote:

I was able to fix this issue by updating cocoapods to version 1.0.1. If
you're still having trouble after updating, try uninstalling cocoapods
and then doing a fresh install.

AWS pods are now working for me just fine using Xcode 8 with Swift 2.3

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aws/aws-sdk-ios/issues/413#issuecomment-247909802,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJ1zBOZzOWXj0QAl7mJVw5AJYwLVdMXRks5qrg_6gaJpZM4JAte-
.

we released v 2.4.9 which fixes the AWSURLRequestRetryHandler.h bug in S3.

With regards to Swift 3, you should be able to use it with sdk, there will be some syntax issues due to name translations, we are working to update the documentation to reflect these changes.

For issues related to "Include of non-modular header header inside framework" i recommend that you update the cocoapods to the latest version.

@karthiksaligrama @mitchellporter Thank you

I'm receiving the "include of non-modular header" when trying to use AWSSES. I've added AWSCore and AWSS3 manually (by downloading the SDK and adding it to the Embedded Binaries) and those work fine. But when I try to add AWWSES, I am unable to compile. I've added the run script, and tried to clean the build folder and frameworks, but still have compilation issues. I've tried using cocoapods, but it raises errors with AWSCore, as well as AWSSES, so I'd rather stick to adding the frameworks manually.
I should also add that the "Could not build Objective-C module 'AWSSES'" comes up when I try "import AWSSES" in a Swift file.

I've tried reinstalling the AWS SDKs for iOS several times on XCode 8 and iOS10.2. I can clean it up to get past virtually all compiler errors except this one:
ld: entry point (_main) undefined. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This message follows a page long list of code. I'm starting to think it's not possible to integrate the following AWS frameworks: AWSCore, AWSCognito, AWSDynamoDB, AWSS3, and AWSMobileHubHelper, integrated with FBSDKLoginKit and FBSKCoreKit. If I want to make an app in iOS using AWS, does it need to be a legacy version of iOS8?

I don't think I can, or anyone can, overcome my Mach-O error above. I tried all the suggestions online for similar problems to no avail. It's really that AWS isn't the solution for making an app in iOS10, right?

Was this page helpful?
0 / 5 - 0 ratings