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

CocoaPods 打包报错,不知道不知道哪里出问题了,求助

  •  
  •   lvlingsheng · 2016-09-16 12:58:37 +08:00 · 8666 次点击
    这是一个创建于 2778 天前的主题,其中的信息可能已经有所发展或是发生改变。

    第一次用 CocoaPods 打包,本地编译都可以通过,没有任何错误提示。使用 CocoaPods lint 的时候,提示

    • ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use --verbose for more information.
      • ERROR | [iOS] xcodebuild: /Users/olddonkey/Documents/Projects/ODTouchID/ODTouchID/ODTouchID.swift:54:38: error: type 'LAPolicy' has no member 'deviceOwnerAuthenticationWithBiometrics'
      • NOTE | [iOS] xcodebuild: if context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &authError) {
      • ERROR | [iOS] xcodebuild: /Users/olddonkey/Documents/Projects/ODTouchID/ODTouchID/ODTouchID.swift:55:36: error: type 'LAPolicy' has no member 'deviceOwnerAuthenticationWithBiometrics'
      • ERROR | [iOS] xcodebuild: /Users/olddonkey/Documents/Projects/ODTouchID/ODTouchID/ODTouchID.swift:115:17: error: use of unresolved identifier 'DispatchQueue'
      • ERROR | [iOS] xcodebuild: /Users/olddonkey/Documents/Projects/ODTouchID/ODTouchID/ODTouchID.swift:120:17: error: use of unresolved identifier 'DispatchQueue'

    比如说 LAPolicy 那里,我的代码是这样的: if context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &authError) { context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: messageOnAuth, reply: { (success, evalPolicyError) in if success {

    很标准的 TouchID 使用,求助为啥会出现这样的错误

    万分感谢

    8 条回复    2019-08-04 17:53:16 +08:00
    onevcat
        1
    onevcat  
       2016-09-16 13:43:59 +08:00 via Android   ❤️ 1
    检查你的 command line 版本是不是 8.0
    检查你的 Cocoa Pods 是不是 1.1.0
    检查你的 podspec 里有没有设置正确的 Swift Version
    检查你的项目下有没有放版本合适的 .swiftversion 文件
    lvlingsheng
        2
    lvlingsheng  
    OP
       2016-09-16 14:15:05 +08:00
    @onevcat 猫神好,前三条都有,最后一条没有,我参考了你的 kingfisher ,但是不知道这文件是 cocoapods 会生成的还是需要手动添加的?
    onevcat
        3
    onevcat  
       2016-09-16 17:30:40 +08:00
    需要你手动加,放在 repo 根目录下。 CocoaPods 1.1.0 在 lint 的时候会默认用 Swift 2.3 的 toolchain 。
    onevcat
        4
    onevcat  
       2016-09-16 17:31:27 +08:00
    应该是 .swift-version 。少了个横杠..
    lvlingsheng
        5
    lvlingsheng  
    OP
       2016-09-16 22:08:18 +08:00
    @onevcat 感谢喵神,终于搞定了。
    网上搜了两天也没找到答案,感觉官网如果出个介绍就更好了。

    再次感谢喵神
    onevcat
        6
    onevcat  
       2016-09-17 11:35:23 +08:00 via Android
    CocoaPods repo 的 issue 里有讨论,而且 p-r 里也有明确写。也就前天昨天的东西,搜不到挺正常的。
    lvlingsheng
        7
    lvlingsheng  
    OP
       2016-09-17 16:03:59 +08:00
    @onevcat 还有个问题, CocoaDocs 需要额外配置么?目前试了很多办法,读不到程序中的备注
    Aox
        8
    Aox  
       2019-08-04 17:53:16 +08:00
    把时间浪费在找个问题上 简直不值得 想想都生气 去他大爷的 repo push
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3249 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:18 · PVG 21:18 · LAX 06:18 · JFK 09:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.