Aws-sdk-ios: AWSCore XCode 8.0 compilation error for include of non-modular header inside framework module

Created on 31 Aug 2016  Â·  36Comments  Â·  Source: aws-amplify/aws-sdk-ios

XCode Version 8.0 beta 6 (8S201h)
iOS 10.0 (14A5346a)
Cocoapod version 0.39.0

AWSFMDatabase+Private.h:12:9: Include of non-modular header inside framework module 'AWSCore'

#import <sqlite3.h> <<<<<<<<<---------------- This is the error

I've added the following to the Podfile:

def allow_non_modular_includes(installer)
  installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
    configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
  end
end

But I still get the compilation error. Any suggested workarounds?

Most helpful comment

I haven't found any. Super frustrating not to have this working. Anyone else?

All 36 comments

I have the same issue and also the import bridging header failed

I'm also getting this same error

I currently have this issue on Xcode 8 GM as well.

This is present with latest XCode8 release... anyone knows how to get around it?

I haven't found any. Super frustrating not to have this working. Anyone else?

Why don't you use Carthage?

I have the same issue even when I manually link to the framework.

I worked around this issue by removing AWS from my project and writing my own server that does the file uploading to S3. That's not a real solution for most people that don't want to write their own auth and server though.

Same here...

We currently don't have support for Swift 3. Swift 2 can be used by setting the "use legacy swift " flag in the Swift compiler settings of the project.
Can some one please post the steps to reproduce this?

This isn't a Swift issue, this is an Xcode IDE/framework import issue. Xcode has changed the handling of non-modular frameworks in such a way that it breaks the usage of AWSCore as a framework in Xcode 8.

Any workaround?

I had to include the sdk manually.
On Thu, Sep 15, 2016 at 23:03 Kyle Smyth [email protected] wrote:

Any workaround?

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

Hernán G. Gonzalez
Indeba.com, CEO.

Just an update from me. Including the SDK manually worked for me, but also updating cocoapods to the latest version worked as well. The pods were installed under:

target 'xxxx' do
        pod 'AWSCognito', '~> 2.4.8'
end

Hi @michaelfrain , could you please provide some steps by which I can reproduce this? I am unable to reproduce this on my side.

The pattern I'm using is listing AWSCore and AWSS3 as dependencies in the .podspec file for one of my app's main pods. I cannot provide that pod to you directly as it is not publicly available from my company.

Whats the version of cocoapods that you are using? We only support cocoapods 1.0.0+

I got a workaround by downloading and linking to frameworks manually instead of cocoapods.
Also had to remove -Objc-C linker flag.

I'm encountering the same issue. I set the allow-nonmodular-header to Yes, tried manually linking the framework, and tried downgrading the SDK to 2.4.7, but none of them worked for me... I updated Cocoapods to 1.0.1 and still doesn't work.

I have also tried to import the "framework" instead of using the Pods but i still get the same error.
and i am using the latest 2.4.8

downgrading to 2.4.7 seems to fix AWS SDK related issues for me.

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

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.

fixed the AWSURLRequestRetryHandler.h' with 2.4.9, If you are still having issues i would recommend updating the CocoaPods to the latest release.

@karthiksaligrama is that for Swift 3.0?

@alexandreamel you should be able to use this with swift 3 on principal since the entire sdk is in objective c. However there might be some name translation issues, we are working towards providing better documentation for swift 3 customers.

I confirm, that updating the CocoaPods and the AWS SDK fixes this issue.
Thank you for the fix.

@digitwolf what version of Cocoapods are you using that fixes this problem? I am using cocoa pods 1.0.1 and AWSCore 2.4.9. I still get the compilation error.

Cocoapods version 1.1.0.rc.2, AWSCore 2.4.10 – still having the issue. I think this should be reopened. If anyone has a workaround I'd really appreciate it!

Cocoapods 1.0.1 and AWS 2.4.10 still gave me trouble until a did a thorough cleaning: https://github.com/aws/aws-sdk-ios/issues/413#issuecomment-230145323

Now everything works great!

How to use sdk manually other than cocoa pods?

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 posted this on another thread, but am posting here since this is the second time I've had this issue, and both times I spent days trying to fix it.
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 run into this issue again but with XCTests only. I can compile my app no problem if I try using XCTest I get the same error. Xcode 10, iOS 11+ Any thoughts?

Setting allow non-modular to YES does nothing.

@jdriselvato Did you solve eventually? I get the same error in the same circumstances. AWS SDK 2.9.3

Had the same issue with test target building fails, eventually fixed it the way described here: switched to the 'non-recursive' option in the entry at Header Search Paths for the test target.
@jdriselvato @RMesterca

I too face this issue in appsync integration
Include of non-modular header inside framework module 'AWSAppSync.AWSAppSync': '/FILE_PATH/Pods/Target Support Files/AWSAppSync/AWSAppSync-umbrella.h'

Much appreciated for any help on this

AWSAPPsync #IOS

Was this page helpful?
0 / 5 - 0 ratings