BDBOAuth1Manager icon indicating copy to clipboard operation
BDBOAuth1Manager copied to clipboard

Cocoapods and use_frameworks!

Open chug2k opened this issue 8 years ago • 5 comments

Hi,

This is more of a question about cocoapods, so sorry if this is the wrong place to ask! When integrating it into a vanilla Xcode project, using a Podfile with the use_frameworks! option, I get complaints about not being able to find the correct header files. I can change the path of the #import statements from:

#import "AFHTTPRequestOperationManager.h"

to

#import <AFNetworking/AFHTTPRequestOperationManager.h>

My symptoms are exactly as http://stackoverflow.com/questions/30262891/cocoapods-framework-cannot-find-file-in-another-cocoapods-framework, but I don't understand how to make this work.

Anyone have suggestions?

Thanks, Charles

chug2k avatar Sep 05 '15 12:09 chug2k

Hey, I am also having this issue. I think the problem is when trying to mix objc/swift frameworks, with the use_frameworks! option, Cocoapods is able compile without a bridging header.

So instead of having a bridging header you can import the necessary frameworks on top for each file using:

import AFNetworking

But the issue I came across was when trying to import the BDBOAuth1Manager module which gave me the following error: Could not build objective-c module. I tried installing each module without the use_frameworks! option and it would build just fine. However, once I included swift libraries it becomes a problem.

EDIT: Same issue as this: Link

-Eric

**PS: Are you a Bloc mentor by any chance?

Dwar3xwar avatar Sep 16 '15 14:09 Dwar3xwar

Yeah, I had the same problem. I wonder if this is a bug with swift or this pod? I haven't had this problem with any other pods.

(And yes, I work for Bloc! :grinning:)

chug2k avatar Sep 21 '15 06:09 chug2k

Seems like a problem with this pod because there were no other problems with any other.

(I tried to use this to authenticate the Yelp API for Bloc Spot, but guess I can't lol)

Dwar3xwar avatar Sep 22 '15 03:09 Dwar3xwar

Hi guys. Sorry for not responding to this sooner. As mentioned in the referenced issue above, I spent a little time this weekend trying to debug this issue. Considering I didn't have any Swift-based project utilizing this pod, I never ran into the issue. I wrote another demo app in Swift in attempt to find an answer for everyone, but unfortunately I ran out of time this weekend. I'll try my best to do a little more work on it this evening. Thanks for being patient!

bdbergeron avatar Sep 22 '15 17:09 bdbergeron

@chug2k If you change the #import lines to @import, does it work for you?

// Change this
#import <AFNetworking/AFHTTPRequestOperationManager.h>
// to this
@import AFNetworking.AFHTTPRequestOperationManager;

bdbergeron avatar Oct 11 '15 23:10 bdbergeron