V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
pheyer
V2EX  ›  iDev

用 CocoaPods 安装的库在 Release 模式下编译失败

  •  
  •   pheyer · 2015-06-17 18:06:29 +08:00 · 2785 次点击
    这是一个创建于 3234 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Archive与Profile时设置Release模式都是编译失败,Profile时如果设置为Debug编译就没有问题。报的错为Undefined symbols for architecture armv7(或arm64)
    找到那些库的.a文件,用lib -info命令查询,要不就全是armv7格式的,要不就全是armv7格式,搞不清是哪里设置不对,这里有人碰到过吗?
    8 条回复    2015-06-18 02:57:20 +08:00
    pheyer
        1
    pheyer  
    OP
       2015-06-17 18:12:43 +08:00
    排除Build Active Architecture Only设置问题,都设置了Debug为YES,Release为NO.
    fangjinmin
        2
    fangjinmin  
       2015-06-17 18:15:29 +08:00
    看看Pods.release.xcconfig的设置对不对吧。
    pheyer
        3
    pheyer  
    OP
       2015-06-17 18:23:01 +08:00
    @fangjinmin 要看哪项?我简单对比了Pods.release.xcconfig和Pods.debug.xcconfig,应该是一样的
    pheyer
        4
    pheyer  
    OP
       2015-06-17 18:47:13 +08:00
    有个地方弄错了,应该是没有生成Release版本的pod版本库,在DerivedData文件夹中,无论是app的Build/Intermediates/Pods.build路径下还是Build/Products/路径下,都没有生成Release-iphoneos文件夹,自然也就没有Release库了。还是很奇怪。
    报错是在最后一步Link时才出错的,也就是前面的cocoapods库和自己的源码编译都没有问题
    pheyer
        5
    pheyer  
    OP
       2015-06-17 19:23:55 +08:00
    现在的问题是生成了Release-iphoneos文件夹,而且其中的.a库用lipo -info命令查看都是支持armv7 arm64,依然是报同样的错
    pheyer
        6
    pheyer  
    OP
       2015-06-17 20:11:36 +08:00
    解决了,真TM坑啊,要在Build Setting - Linking - Other Linker Flags - Release - Any Architecture | Any SDK里加上$(inherited),使得Other Linker Flags下Debug和Release都显示一样的,光对Release设置$(inherited)无效。
    另外上面做完后,编译还是一样的错,clear deriveddata文件夹后再编译就好了
    wajmjjj
        7
    wajmjjj  
       2015-06-17 20:55:53 +08:00
    原来是这样
    wezzard
        8
    wezzard  
       2015-06-18 02:57:20 +08:00 via iPhone
    我也遇到過同樣的問題
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3257 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 13:40 · PVG 21:40 · LAX 06:40 · JFK 09:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.