New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cocoapods fails to link some library files #225

Closed
malectro opened this Issue Feb 2, 2015 · 5 comments

Comments

Projects
None yet
5 participants
@malectro
Copy link
Contributor

malectro commented Feb 2, 2015

In an effort to centralize the conversation about this issue:

The Mixpanel cocoapods is set to link libMPCategoryHelpers.a and libuicore.dylib but sometimes fails to do so during installation. In most cases customers have been successful in manually linking the libs within their projects, but we're currently working on a more better solution.

Edit:
After some digging, it looks like Cocoapods requires the -ObjC linker flag (and amends the "Other Linker Flags" Build Setting) upon installation. Though adding -ObjC flag is the preferred method for loading static libraries with Categories, developers that have fine-tuned library and framework linking can mess up their build process by doing so. This could be why some libraries aren't linking in the first place, but I'm not yet sure.

Cocoapods effectively made this a wont-fix with the idea that "frameworks are on the horizon", but it's possible to link each lib manually using the force_load tag. For an app using the latest version of Cocoapods (as of 0.35) and Mixpanel 2.7, the Other Linker Flags should look like this

screen shot 2015-02-03 at 6 33 54 pm

For apps integrating Mixpanel without Cocoapods, I'd recommend simply adding the -ObjC flag, but if this isn't possible, customers can force_load MPCategoryHelpers by adding -force_load $(SRCROOT)/path/to/libMPCategoryHelpers.a to their linker build settings. (Note that "path/to" is just a placeholder for the path to the lib within the app.)

@Suz

This comment has been minimized.

Copy link

Suz commented Feb 20, 2015

I just had this problem with SocketRocket and nothing made sense: the -ObjC flag is there and the libraries are linked, but it was still giving errors. Finally realised that I had added SocketRocket to both my App and to the test target, but I had only linked the App against the library. I was getting the error because the test target also needed to be linked. Duh.

@samgreen

This comment has been minimized.

Copy link
Contributor

samgreen commented Jul 15, 2015

This will be resolved with #288.

@jbwyme jbwyme added the v2.8.2 label Jul 16, 2015

@samgreen

This comment has been minimized.

Copy link
Contributor

samgreen commented Jul 17, 2015

This should be resolved now if you want to do a pod update.

@samgreen samgreen closed this Jul 17, 2015

@shaunbruno

This comment has been minimized.

Copy link

shaunbruno commented Nov 20, 2015

This is not fixed

@shaunbruno

This comment has been minimized.

Copy link

shaunbruno commented Nov 20, 2015

screen shot 2015-11-20 at 12 49 33 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment