Skip to content
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

Podspec does not work #4

Open
Linda5Zhang opened this issue Jun 20, 2014 · 16 comments
Open

Podspec does not work #4

Linda5Zhang opened this issue Jun 20, 2014 · 16 comments

Comments

@Linda5Zhang
Copy link

Thanks for the pushed podspec, but there is probably a problem with the podspec.
We met an architecture problem using that podspec.
The error is Undefined symbols for architecture armv7:, or arm64: or i386.
Could you please fix the podspec? Thanks~

@willrust
Copy link
Contributor

Hello Linda5Zhang, A couple questions for ya.. Under your application target's Build Settings, what do you have under Valid Architectures and Other Linker Flags?

@Linda5Zhang
Copy link
Author

Under the Valid Architectures, they're standard architectures(arm64 armv7 armv7s),
Under Other Linker Flags, it's -all_load -ObjC.

@willrust
Copy link
Contributor

Any issues preventing you from using $(inherited) under Other Linker Flags to pickup the framework from CocoaPods?

@Linda5Zhang
Copy link
Author

we already used $(inherited) under Other Linker Flags
screen shot 2014-06-23 at 5 50 53 pm

@willrust
Copy link
Contributor

-framework KISSmetricsSDK should have been added.
As a quick fix please try applying that manually.

It seems to be working fine when added to new and existing projects with Xcode 5.1.1 and CocoaPods 0.33.1.
Which version of Xcode and CocoaPods are you using?

@Linda5Zhang
Copy link
Author

-framework KISSmetricsSDK should have been added.

It works, if I add -framework KISSmetricsSDK under Other Linker Flags

Which version of Xcode and CocoaPods are you using?

My Xcode version is 5.1.1 and CocoaPods version is 0.33.1

@willrust
Copy link
Contributor

I'm glad that quick fix worked for you.

We've tested this on a couple machines with the same setup. I don't think this is an issue with the podspec, but I'm going to leave this open for a while.

If anyone else is running into the same issue, please post some details.

@Linda5Zhang
Copy link
Author

Thank you for the answers and suggestions~

@jchambers
Copy link

I'm having the same problem, and it's also solved by adding -framework KISSmetricsSDK. I took a look at the symbols defined in the framework itself ($ nm KISSmetricsSDK.framework/KISSmetricsSDK) and saw basically what I would have expected. The symbol list is long, and I posted it as a gist for reference.

Then I took a look at the .a file that's produced when we build the pods:

$ nm libPods-KISSmetrics-iOS-SDK.a 

libPods-KISSmetrics-iOS-SDK.a(Pods-KISSmetrics-iOS-SDK-dummy.o):
         U _OBJC_CLASS_$_NSObject
00000324 S _OBJC_CLASS_$_PodsDummy_Pods_KISSmetrics_iOS_SDK
         U _OBJC_METACLASS_$_NSObject
00000310 S _OBJC_METACLASS_$_PodsDummy_Pods_KISSmetrics_iOS_SDK
         U __objc_empty_cache
000002e8 s l_OBJC_CLASS_RO_$_PodsDummy_Pods_KISSmetrics_iOS_SDK
000002c0 s l_OBJC_METACLASS_RO_$_PodsDummy_Pods_KISSmetrics_iOS_SDK

The list is, obviously, pretty sparse and missing basically all of the symbols I would have expected. The same is true if we look at libPods.a itself. I'm not entirely sure what's supposed to happen when a podspec uses vendored_frameworks to include a pre-built framework, but my intuition would have been that the symbols from the framework should have made it into libPods.a by some means.

My hunch is that by specifying -framework KISSmetricsSDK in our own project, we're basically making an end-run around cocoapods and importing the framework directly. It's just incidentally on the framework search path because (a) the podspec called for it to be there and (b) we're inheriting the search path from the pods project.

In short, I'm not sure how this is supposed to work, but I'm still suspicious that something is amiss with the podspec.

@jchambers
Copy link

-framework KISSmetricsSDK should have been added.

To be clear, that is added to our Pods project, but not our main project, which makes sense to me.

@willrust
Copy link
Contributor

Jon, when we include the SDK via CocoaPods in both new and existing projects -framework KISSmetricsSDK is added to the project's Other Linker Flags. This leads me to believe that it should be there. Why some people would need to add it manually, I'm not sure yet.

@willrust
Copy link
Contributor

willrust commented Aug 6, 2014

Updated the podspec for v2.1.0. Hopefully this fixes the linking error.

@Linda5Zhang
Copy link
Author

Updated the podspec for v2.1.0. Hopefully this fixes the linking error.

Thanks for the update, I tried the updated podspec for v2.1.0, still have the same error :(

@willrust
Copy link
Contributor

@Linda5Zhang the latest podspec adds a path to the framework within the pods directory. Hoping that helps.

@Linda5Zhang
Copy link
Author

It works now, thanks~

@charliewilliams
Copy link
Contributor

charliewilliams commented Nov 15, 2017

Should this issue be closed?

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

Successfully merging a pull request may close this issue.

4 participants