Travis-CI错误与__nonnull

时间:2016-02-03 21:26:57

标签: ios objective-c xcode cocoapods travis-ci

我的.travis.yml文件:

language: objective-c

before_install:
   - rvm use system
   - sudo gem install cocoapods -v '0.39.0'  

script: 
    xctool -workspace ProjectName.xcworkspace -scheme ProjectName build -sdk iphonesimulator

虽然Travis-CI正在构建项目,但我遇到了多个错误:

- (instancetype __nonnull)initWithConfiguration:(NSURLSessionConfiguration *__nullable)configuration NS_DESIGNATED_INITIALIZER;
                ^
- (instancetype __nonnull)initWithConfiguration:(NSURLSessionConfiguration *__nullable)configuration NS_DESIGNATED_INITIALIZER;
  ^

因此Travis Xcode抱怨与__nonnull

相关的事情

1 个答案:

答案 0 :(得分:2)

要解决这个问题,我在.travis.yml文件中使用此行强制Travis Xcode为7.2版本:

osx_image: xcode7.2

所以我的最终.travis.yml文件是:

我的.travis.yml文件:

language: objective-c

osx_image: xcode7.2

before_install:
   - rvm use system
   - sudo gem install cocoapods -v '0.39.0'  

script: 
    xctool -workspace ProjectName.xcworkspace -scheme ProjectName build -sdk iphonesimulator

正如我在另一篇answer中所说,sudo gem install cocoapods -v '0.39.0'也迫使特拉维斯使用所需的Cocoapods版本

I also wrote a post in my blog about Travis-CI.