Open Linda5Zhang opened 10 years ago
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?
Under the Valid Architectures
, they're standard architectures(arm64 armv7 armv7s
),
Under Other Linker Flags
, it's -all_load -ObjC
.
Any issues preventing you from using $(inherited) under Other Linker Flags to pickup the framework from CocoaPods?
we already used $(inherited) under Other Linker Flags
-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?
-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
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.
Thank you for the answers and suggestions~
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.
-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.
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.
Updated the podspec for v2.1.0. Hopefully this fixes the linking error.
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 :(
@Linda5Zhang the latest podspec adds a path to the framework within the pods directory. Hoping that helps.
It works now, thanks~
Should this issue be closed?
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:
, orarm64:
ori386
. Could you please fix the podspec? Thanks~