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
q409195961
V2EX  ›  iDev

在 Jenkins 中使用 xcodebuild 打包,同份代码,两台机器一台报错,一台成功,头疼...

  •  
  •   q409195961 · 2017-10-16 19:42:51 +08:00 · 4335 次点击
    这是一个创建于 2597 天前的主题,其中的信息可能已经有所发展或是发生改变。

    公司要求要在 Jenkins 上打生产包

    很久前配置了旧平台,一直可以正常编译打包

    最近推了一个新平台,要求迁移过去,然后 shell 脚本和旧平台一样

    但 xcodebuild 的时候就报莫名其妙的错误

    命令:

    xcodebuild archive -workspace "${targetStr}.xcworkspace" -scheme $targetStr -configuration Release IPHONEOS_DEPLOYMENT_TARGET=8.0 -archivePath $archivePath 
    

    部分报错(除了 AFNetworking,还有其他第三方框架也报):

    In file included from /Users/省略路径 /Classes/System/PrefixHeader.pch:34:
    In file included from /Users/省略路径 /Classes/Main/Tool/Network/RequestTool.h:10:
    In file included from /Users/省略路径 /Classes/Main/Tool/Network/NetworkRequestTool.h:9:
    /Users/省略路径 /Pods/Headers/Public/AFNetworking/AFNetworking.h:1:1: error: expected identifier or '('
    ../../../AFNetworking/AFNetworking/AFNetworking.h
    ^
    In file included from /Users/省略路径 /Classes/System/PrefixHeader.pch:34:
    In file included from /Users/省略路径 /Classes/Main/Tool/Network/RequestTool.h:10:
    /Users/省略路径 /Classes/Main/Tool/Network/NetworkRequestTool.h:16:1: error: unexpected '@' in program
    @property (copy, nonatomic) NSString *requestMethod;
    ^
    /Users/省略路径 /Classes/Main/Tool/Network/NetworkRequestTool.h:18:4: error: expected a type
    + (NetworkRequestTool *)sharedInstance;
       ^
    /Users/省略路径 /Classes/Main/Tool/Network/NetworkRequestTool.h:18:1: error: missing context for method declaration
    + (NetworkRequestTool *)sharedInstance;
    ^
    /Users/省略路径 /Classes/Main/Tool/Network/NetworkRequestTool.h:20:1: error: expected method body
    - (void)getSeriviceWithSuccess:(void (^)(id responseObject))success
    ^
    /Users/省略路径 /Classes/Main/Tool/Network/NetworkRequestTool.h:23:1: error: missing context for method declaration
    - (void)postSeriviceWithSuccess:(void (^)(id responseObject))success
    ^
    /Users/省略路径 /Classes/Main/Tool/Network/NetworkRequestTool.h:26:1: error: expected method body
    - (void)postSeriviceWithConstructingBodyWithBlock:(void(^)(id<AFMultipartFormData> formData))constructingBodyWithBlock success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;
    ^
    /Users/省略路径 /Classes/Main/Tool/Network/NetworkRequestTool.h:28:1: error: '@end' must appear in an Objective-C context
    @end
    ^
    In file included from /Users/省略路径 /Classes/System/PrefixHeader.pch:34:
    /Users/a 省略路径 /Classes/Main/Tool/Network/RequestTool.h:37:44: error: no type or protocol named 'AFMultipartFormData'
         constructingBodyWithBlock:(void(^)(id<AFMultipartFormData>  formData))constructingBodyWithBlock
                                               ^
    /Users/省略路径 /Classes/Main/Tool/Network/RequestTool.h:43:42: error: no type or protocol named 'AFMultipartFormData'
       constructingBodyWithBlock:(void(^)(id<AFMultipartFormData>  formData))constructingBodyWithBlock
                                             ^
    /Users/省略路径 /Classes/Main/Tool/Network/RequestTool.h:49:49: error: no type or protocol named 'AFMultipartFormData'
              constructingBodyWithBlock:(void(^)(id<AFMultipartFormData>  formData))constructingBodyWithBlock
                                                    ^
    /Users/省略路径 /Classes/Main/Tool/Network/RequestTool.h:55:48: error: no type or protocol named 'AFMultipartFormData'
             ConstructingBodyWithBlock:(void(^)(id<AFMultipartFormData> formData))constructingBodyWithBlock
                                                   ^
    
    In file included from /Users/省略路径 /Classes/Main/Tool/Refresh/RefreshHeader.h:9:
    /Users/省略路径 /Pods/Headers/Public/MJRefresh/MJRefreshNormalHeader.h:1:1: error: expected identifier or '('
    ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h
    ^
    
    ** ARCHIVE FAILED **
    
    
    The following build commands failed:
    	ProcessPCH /Users/省略路径 /PrefixHeader.pch.pch ./xxxxx/Classes/System/PrefixHeader.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    	ProcessPCH /Users/省略路径 /PrefixHeader.pch.pch ./xxxxx/Classes/System/PrefixHeader.pch normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    (2 failures)
    
    
    3 条回复    2017-12-03 12:35:03 +08:00
    louzhumuyou
        1
    louzhumuyou  
       2017-10-16 20:54:41 +08:00
    应该分开看,直接 xcodebuild 在新平台上能打包吗?不通过 Jenkins 调度,如果不行的话,应该是新机器配置的问题,xcode9 升级后,我维护的打包平台也需要解决一堆兼容问题,比如 oclint,比如 slather。。。。
    Jackiehu
        2
    Jackiehu  
       2017-11-01 11:35:43 +08:00
    fastlane gym --export_method ad-hoc --output_name XXX --clean

    fastlane 打包就这一句话搞定
    dsqtb
        3
    dsqtb  
       2017-12-03 12:35:03 +08:00
    嗯,fastlane 还是比较好用,
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1003 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:46 · PVG 05:46 · LAX 13:46 · JFK 16:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.