Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Cocoapods and use_frameworks! #35

Open
chug2k opened this issue Sep 5, 2015 · 5 comments
Open

Cocoapods and use_frameworks! #35

chug2k opened this issue Sep 5, 2015 · 5 comments

Comments

@chug2k
Copy link

chug2k commented Sep 5, 2015

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

@Dwar3xwar
Copy link

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?

@chug2k
Copy link
Author

chug2k commented Sep 21, 2015

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! 😀)

@Dwar3xwar
Copy link

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)

@bdbergeron
Copy link
Owner

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
Copy link
Owner

@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;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants