Include of Non Modular Header and file not found for sqlite3.h in Swift with AWS SDK - ios

I'm caught between two very peculiar errors in an iOS Swift project. When I attempt to compile my project, I receive a "Include of Non-modular header" error due to several files in the AWSCore framework of the AWS iOS SDK requiring "sqlite3.h" as an import.
After spending several hours looking for solutions, I eventually copied a copy of the file into the AWSCore folder in my project from Cocoapods, and this removes the issue, compiling my project successfully. However, when I clean the build and attempt to rebuild, I receive a "Lexical or Preprocessor issue - file not found" due to the extra SQLite3.h file.
When I remove it, the compile process will go up to the "include of Non-modular header" error again.
I have already tried nearly all of the common solutions - set include of modular headers to yes, removing the framework and readding, adding "." to the header/framework search paths recursively. I'm now completely stumped, so any help would be greatly appreciated. Thanks!

could you provide more details about this problem?
"several files in the AWSCore framework of the AWS iOS SDK requiring "sqlite3.h" as an import." could you provide a list of files that causes the error? May I know what version of AWS Mobile SDK are you using? Did you installed it by using Cocoapods or downloaded from Amazon Website?
Have you tried changing the build setting CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES or 'Allow Non-module includes In Framework Modules' to Yes? Just search 'module' in the Frameworks Build Settings to find it. You may need to clean the build first before change this setting.

Related

Using Xcode project in react native plugin causes header file not found errors

I'm developing a react native plugin (iOS) that uses another project as depencency. Building the project on its own, no errors occur. When I build a react native app with my plugin inside, I get the error that some header files are not found in my plugin.
My structure
MyReactNativeApp
node_modules
myPlugin
iOS
myPlugin.xcodeproj
folder1
myProject1.xcodeproj
folder2
myProject2.xcodeproj
folder3
file1.h
folder4
file2.h
myProject2 has some header files defined that reference to each other.
When I build myProject1.xcodeproj, there are no errors. When I build myPlugin, the header files can't include each other.
The header search paths are set. This shouldn't be the problem.
Does someone may has an idea what could be the reason?
I didn't find a solution for this problem, but one for my actual problem that .framework modules couldn't be found. Due to this error I tried to add the project directly.
If a .framework module could not be found, you need to add this to your .podspec file of myPlugin
s.vendored_frameworks = 'ios/Frameworks/myProject1.framework', 'ios/Frameworks/myProject2.framework'
s.public_header_files = 'ios/Frameworks/myProject1.framework/**/*.h'
Maybe only the s.public_header_files will fix the error in the question.

'FBSDKShareKit/FBSDKShareKit.h' file not found

I've made an IOS build on Unity for an App we're making after adding the facebook SDK, moved the build on a hard drive and tried to build it on xcode on the mac we have at the office, as I always do before uploading it to the app store. I ran into this error and I've been stuck on this issue for 2 full work days and it's driving me a bit crazy, here are the thing's I've tried:
-Install cocoapods, both on the default terminal directory and on the project's directory (I'm not too experienced with cocoapods so I don't know if that made a difference. I also did pod update while standing on the project directory).
-I saw that the IOS resolver has an option called "generate pod files" that people said needed to be checked when building to solve this issue. It was checked by default on my project, so that wasn't it.
-Added the framework path on the build settings to where the facebook SDK is at (though the way it looked on my xcode seemed a bit different than the way I've seen it on other people's xcode screenshots)
-Tried commenting out some #include lines on the headers that are generating the issue. It only produced more errors.
-People said to open the project from the workspace instead of the xcodeproject but unity doesn't seem to generate a workspace file.
-Tried downgrading the Facebook SDK to a previous version but the versions people claim are working don't seem to be on the repository anymore, so it doesn't let me downgrade to them.
At the moment I'm trying to make it work with the latest Facebook SDK which is 9.0.0.
Any help would be appreciated, please let me know if I'm not being specific enough about the issue or if there's any information about my project I should include on the post
The .xcworkspace should be created by Cocoapods, not by Unity directly.
If you already have the Podfile generated, just run pod install on the project directory and open the created .xcworkspace file after Cocoapods finishes installing the external dependencies.

What is the best practice to include third party ios sdk framework in react-native module library?

I am trying to include ios sdk framework in my react-native module library. I turned always embed swift standard library to Yes in build setting. Everything compiles fine.
Then I include the node module in an app using npm i react-native-my-framework, open sampleapp.xcworkspace and build in XCode, I get an error MyFramework/MyFramework-Swift.h not found. I tried following permutation combinations:
Put MyFramework to Frameworks, Library and Embedded Contents. and tried some other combination of build settings.
Set the framework search path in the library project - $(PROJECT_DIR)/../node_modules/react-native-my-framework/ios/
I manually included libMyFramework.a to Libraries group.
But I am still facing the same issue. What am I missing here?
Also, MyFramework is not on Cocoa pods
Update:
Now MyFramework is available on Cocoapods

Adding Firebase via importing SDK (not CocoaPods) causes file not found exception

I am attempting to add Firebase to my iOS project via importing the SDK instead of using CocoaPods (I'm not a fan).
I have followed the documentation but I am getting file not found error.
I have cleaned, deleted, restarted, re-imported, re-did the instructions SEVERAL times and I keep getting this error.
Has anyone succesfully imported the Firebase SDK into an iOS project?
Added to the projects directory:
The frameworks auto-added themselves to the Linked Frameworks
Added the -ObjC to Other linker flags
But still the file not found error:
Any help?
Inside the frameworks:
Pastebin of the Build file: PASTBIN
Try adding the Firebase SDK to the root directory and later move them to the frameworks folder.

Xcode 7.3.1 - Can't properly setup AWS

A year ago I had a project where I was using AWS. I forget exactly how it worked but it involved a BridgingHeader and no use of Frameworks.
I came back to this project today and none of the AWS stuff was working. I deleted all AWS/pod related files, got rid of the BridgingHeader reliance, cleaned the project, and proceeded to follow the pod-based instructions here:
http://docs.aws.amazon.com/mobile/sdkforios/developerguide/setup.html
However, the project still doesn't recognize any of the AWS libraries (getting the error "Use of unresolved identifier AWS...").
I saw a post by someone that suggested simply putting "import Framework" at the top of the files that use that Framework, but this doesn't work (it doesn't recognize AWSS3 when I put "import AWSS3", for example).
Then I saw advice that suggested figuring out the correct "Framework/Header/Library Search Paths" and so I created a brand new project, copied the podfile, and ran pod install. In this new project I am getting the error:
ld: warning: directory not found for option
'-F/Users/username/Library/Developer/Xcode/DerivedData/TestProj-gmhzshcpuyuvaffaocakhunyepaw/Build/Products/Debug-iphonesimulator/AWSAutoScaling'
for each of the AWS libraries.
When I go into the target build settings, I see that the Framework Search Paths have strings relating to the AWS libraries, but when I delete them I then get the error "ld: Framework not found AWSAutoScaling".
I tried giving the direct path to the respective folders but I get the same error.
I fixed the problem by opening the .xcworkspace file instead of the the .xcodeproj file.

Resources