问题描述
我正在尝试使用Cocoapods将FlurrySDK框架集成到我的应用程序中(因为我已经在使用很多框架了),但是由于某些原因,xcode一直抛出此编译错误:
I'm trying to integrate FlurrySDK framework in my app using Cocoapods (as I'm doing with already a lot of framework) but for some reason xcode keeps throwing this compilation error :
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_Flurry", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我已在Podfile中添加此行:
I've added this line in my Podfile :
pod 'FlurrySDK'
我运行了一个pod更新,成功更新了我的Pods项目(我可以在Pod中看到FlurrySDK )。
and I ran a pod update wich successfully updated my Pods project (I can see FlurrySDK in my pods).
我的AppDelegate.m如下:
My AppDelegate.m is as follow :
#import <FlurrySDK/Flurry.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[Flurry startSession:FLURRY_API_KEY];
...
}
@end
我在这里真是绝望,我想将我的依赖项保留在它们所属的位置,但是FlurrySDK podspec似乎无法正常工作...
I'm really desperate here, I'd like to keep my dependencies where they belong but it's seems that FlurrySDK podspec is not working properly...
推荐答案
我终于找到问题所在,它被链接到我正在使用的库中有问题的podspec文件。
尽管指定库的行已损坏,但在进行 pod更新
时,podspec不会造成任何问题。我更改了:
I finally found out where the issue was, it was linked to a faulty podspec file from a library I was using.The podspec did not pose any problem while making a pod update
although the line specifying the libraries was corrupted. I changed :
s.framework = 'CoreLocation, MapKit'
至
s.framework = 'CoreLocation', 'MapKit'
(请注意,单引号是一个字符串,被编辑为两个字符串的列表),现在一切都恢复了正常。
(note the single quotes: was one string, edited to be a list of two strings) and everything is now back on track.
这篇关于Cocoapods的FlurrySDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!