xCode 7.1: Could not build Objective-C module 'GoogleMaps' - objective-c

I am using the GoogleMaps iOS SDK in my app and added it with cocoapods. However, after updating xCode from 7.0 to 7.1 I'm suddenly getting the following error: Could not build Objective-C module 'GoogleMaps'
In addition xCode also gives me an error in the GoogleMaps.h file in the GoogleMaps.framework:
Include of non-modular header inside framework module 'GoogleMaps'
I already deleted my DerivedData folder, updated cocoapods, reinstalled the GoogleMaps iOS SDK and cleaned and build the framework's scheme and my app's scheme. But nothing helped so far.

Answered in this similar question: xCode 7 error: include of non-modular header inside framework module with Google Maps
...but essentially you'll need to create an Objective-C bridging header file whereas you may not have needed one with Xcode 7.0. The why still eludes me.

you should open the .xcworkspace not .xcodeproj
once you added cocoa pods your project folder will contain the .xcworkspace file

Related

Xcode workspace with iOS and macOS

I have an iOS app which I need to build a supporting app for macOS. I was hoping to share code between them, specially the DataModel.
As the iOS app was using Pods, there was already a workspace.
I pulled in the macOS project into the workspace, and I can see all its files with no problem. But I don't seem to be able to figure out how to 'use' the class files from the iOS project in the macOS project. Would it have anything to do with Modules?
Or should I just make a new Target that is a macOS application?
I'm using Xcode 8.3.3 at the moment, and the projects are in Swift.
Select the source files you want to use and tick the "Target Membership" for your macOS target in the Inspector:
Update:
To use common code in different projects, make an extra project for your common code which builds as a Framework and include this framework in the iOS and in the macOS.
This tutorial might be helpful.

FBSDKCoreKit and the include of non-modular header inside framework module errors

None of the following threads (and many similar) helped me:
Include of non-modular header inside framework module
XCode6: Receiving error "Include of non-modular header inside framework module"
While trying to install the Facebook SDK in my iOS project via cocoapods, I ran into that error:
Inside the FBSDKCoreKit.h header:
Include of non-modular header inside framework module 'FBSDKCoreKit.FBSDKCoreKit'
As I said, I tried the solutions proposed in the answers above without any success.
It's important to mention that this use to work fine on Xcode 7.
Turn on allowing modular headers
Upgrading to the latest version of CocoaPods (1.5.3), the latest Facebook SDK, removing my Pods folder, and doing a fresh pod install fixed this issue for me.
Just deleted the Swift Package Manager Facebook library and run a pod update

Facebook sdk framework not found ios7, xcode5

I am new to Facebook SDK with iOS. I want to send invitation to friends on Facebook for using my app for this I am using Facebook (developer.facebook.com)sdk api I have registered my app installed sdk and imported framework. After importing got error as,
ld: warning: directory not found for option '-
F/Users/vijaywebsolutions/Documents/FacebookSDK'
ld: framework not found FacebookSDKkk
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Why don't you try CocoaPods for your projects its the dependency manager for Objective-C projects.
Refer CocoaPods
Simple Setup
Open Terminal and type sudo gem install cocoapods
Once installed you need to create a simple Pod file in your project directory and add the dependency to that file example.
Go to your project root directory and create Pod File by typing in terminal touch Podfile
Once created add the following line to the podfile.
platform :ios
pod 'Facebook-iOS-SDK', '~> 3.11.0'
Save the file and then in the terminal(where pod file exist) run pod install
Now it will install the requested dependencies and will create a Workspace for your project, you don't need to take any effort to configure it.
Its the best way to manage your dependencies. Give it a try you won't regret.
First you have to include facebook sdk in you project, steps as follows :
click on your project folder in xcode.
go to general tab and find Linked framework and libraries.
in that click on + sign and provide path to FacebookSDK.framework
These steps will facebook sdk in your project.
Then you have to import it in any of .m file where you want to use is it. like following line :
#import <FacebookSDK/FacebookSDK.h>
I also ran into similar error when integrating FacebookSDK into my app. I have added the framework in the Link Binary with Libraries, however, error persisted. One important thing to note when app is built, is it should be build against source Facebook iOS SDK and NOT binary SDK. I got latest source from here Facebook iOS SDK, downloaded Bolts-iOS and XCTOOL and then ran build_framework.sh Once completed, copied FacebookSDK.framework to my app and everything worked perfect.

MailCore CFNetwork.framework Dependency Using Invalid Location

I'm new to Xcode and Objective C development and I'm attempting to import the github MailCore
InboxListener example Xcode project for the Mac OSX environment. I followed the Mac OSX instructions from MailCore's website and the project builds but doesn't run. MailCore seems dependent on /System/Library/Frameworks/CFNetwork.framework which doesn't exist in my /System/Library/Frameworks/ directory on my Mac OS X 10.7.5.
CFNetwork.framework does exist in /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks, but why doesn't MailCore know where to find it? How do I change the location MailCore is using?
I've tried linking CoreServices.framework and CFNetwork.framework in the Build Phases, link with binaries without success. Same runtime error.
Output when Running:
dyld: Library not loaded: /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
Referenced from: /Users/cgray/Library/Developer/Xcode/DerivedData/InboxLister-hjoeknampqddvifxyoqwhozaricj/Build/Products/Debug/MailCore.framework/Versions/A/MailCore
Reason: image not found
(lldb)
It was a brain teaser for me!
I resolved to set the SDK 10.7 in any project and targets of your project, of Mailcore and the Libetpan library.
Then select the libetpan project in the Project navigator and check:
open the CoreService.framework and check if there is the CFNetwork.framework (look below). If it not exists your code cannot include the SDK 10.7 where CFNetwork is under the CoreService umbrella framework.
select "static libetpan" target and check in your "Link Binary With Libraries", you should found the CoreService.framework. If there isn't add it (you can also drag&drop from the Project navigator)
Clean and build, it should work!

Facebook linking issues with iOS project

I guess I'm not linking the Facebook SDK properly with my project. Here's the error I get:
clang: error: no such file or directory: '/Users/username/Library/Developer/Xcode/DerivedData/Whatto-fotukpkslfnxvzbjmykxitdwkyds/Build/Products/Debug-iphonesimulator/libfacebook_ios_sdk.a'
This is an ARC iOS project. Any help would be great.
fyi: the Facebook libfacebook_ios_sdk.a library is red in the Build Phases/Link Binary With Libraries area under Project targets.
thanks
I would suggest dragging and dropping the library in the Project Navigator, then doing a clean followed by a build.
It sounds like you've added the facebook-ios-sdk Xcode project into your project... try just importing the contents of the FBConnect group. No need to include the project files.