美文网首页iOS Developer程序员
使用Cocoapods管理第三方库出现Undefined sym

使用Cocoapods管理第三方库出现Undefined sym

作者: 五分钟学算法 | 来源:发表于2016-05-16 11:03 被阅读1777次

    使用Cocoapods管理第三方库的时候发现  在iPhone6 与iPhone6plus  可以正常运行 但在iPhone4s与iPhone5上运行app时会报如下错误:

    Undefined symbols for architecture i386:

    “_OBJC_CLASS_$_XXX”, referenced from:

    objc-class-ref in XXX

    ld: symbol(s) not found for architecture i386

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    其中xxx是Cocoapods中第三方库的.m文件,在targets界面中找到Build Phases 无法添加该.m文件

    解决方法:在Finder中 按 shift + cmd + G 进入文件夹:~/Library/Developer/Xcode/DerivedData/ModuleCache 将里面的文件全部清除 然后重启Xcode

    解决!

    参考链接:http://stackoverflow.com/questions/26067649/afnetworking-undefined-symbols-for-architecture-i386-objc-class-afhttpsessi

    相关文章

      网友评论

        本文标题:使用Cocoapods管理第三方库出现Undefined sym

        本文链接:https://www.haomeiwen.com/subject/xrrbrttx.html