gpt4 book ai didi

ios - Pod 规范依赖

转载 作者:行者123 更新时间:2023-11-29 11:51:57 24 4
gpt4 key购买 nike

我正在创建一个使用 SwiftState pod 的私有(private) pod。对于这个库,我使用的是 Swift3 分支:

pod 'SwiftState', :git=> 'https://github.com/ReactKit/SwiftState.git', :branch => 'swift/3.0'

项目编译,但当我将此 pod 添加为依赖项时:

s.dependency 'SwiftState'

然后,执行 pod repo push,我在我的项目中使用 Swift 2.3 分支时遇到了同样的错误,然后我注意到 master 分支没有更新到 Swift 3 版本:

ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- ERROR | xcodebuild: SwiftState/Sources/EventType.swift:17:5: error: expected identifier in enum 'case' declaration
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:31:38: error: function types cannot have argument label 'event'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:31:49: error: function types cannot have argument label 'fromState'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:31:63: error: function types cannot have argument label 'userInfo'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:74:13: error: expected 'let' in conditional
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:146:17: error: expected ',' joining parts of a multi-clause condition
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:381:17: error: expected ',' joining parts of a multi-clause condition
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:555:87: error: 'inout' before a parameter name is not allowed, place it before the parameter type instead
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:569:87: error: 'inout' before a parameter name is not allowed, place it before the parameter type instead
- ERROR | xcodebuild: SwiftState/Sources/StateMachine.swift:19:43: error: function types cannot have argument label 'fromState'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/StateMachine.swift:19:57: error: function types cannot have argument label 'userInfo'; use '_' instead
- ERROR | xcodebuild: SwiftState/Sources/StateMachine.swift:53:13: error: expected 'let' in conditional
- ERROR | xcodebuild: SwiftState/Sources/StateMachine.swift:493:17: error: expected ',' joining parts of a multi-clause condition
- ERROR | xcodebuild: SwiftState/Sources/StateType.swift:17:5: error: expected identifier in enum 'case' declaration
- ERROR | xcodebuild: SwiftState/Sources/Machine.swift:27:32: error: single argument function types require parentheses
- ERROR | [iOS] xcodebuild: SwiftState/Sources/_HandlerInfo.swift:19:24: error: assigning non-escaping parameter 'handler' to an @escaping closure
- NOTE | [iOS] xcodebuild: SwiftState/Sources/_HandlerInfo.swift:15:53: note: parameter 'handler' is implicitly non-escaping
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Disposable.swift:38:23: error: assigning non-escaping parameter 'action' to an @escaping closure
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Disposable.swift:37:17: note: parameter 'action' is implicitly non-escaping
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:26:19: error: enum case 'Any' not found in type 'Event<E>'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:39:21: error: type 'Event<_>' has no member 'Any'
- NOTE | xcodebuild: SwiftState/Sources/EventType.swift:17:10: note: did you mean 'Any#'?
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:57:16: error: enum case 'Any' not found in type 'Event<E>'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:69:11: error: enum case 'Any' not found in type 'Event<E>'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/EventType.swift:79:11: error: enum case 'Any' not found in type 'Event<E>'
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:71:26: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:84:26: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:89:29: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:103:34: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:142:41: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:215:37: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:233:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:238:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:244:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:249:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:259:29: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:290:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:295:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:301:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:306:27: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:414:28: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:419:28: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:433:30: warning: extraneous duplicate parameter name; 'event' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:456:33: warning: extraneous duplicate parameter name; 'order' already has an argument label
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:503:20: warning: operator should no longer be declared with body; use a precedence group instead
- WARN | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:540:47: warning: extraneous duplicate parameter name; 'fromState' already has an argument label
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:24:34: error: single argument function types require parentheses
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:49:41: error: single argument function types require parentheses
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:56:36: error: single argument function types require parentheses
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:95:86: error: 'Some' has been renamed to 'some'
- NOTE | [iOS] xcodebuild: Swift.Optional<Wrapped>:5:24: note: 'Some' has been explicitly marked unavailable here
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:113:51: error: binary operator '==' cannot be applied to operands of type 'Event<E>' and '_'
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:113:51: note: overloads for '==' exist with these partially matching parameter lists: (Event<E>, Event<E>), (Event<E>, E), (T, T), (Self, Self)
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:130:45: error: missing argument label 'condition:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:145:46: error: extraneous argument labels 'event:fromState:userInfo:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:163:77: error: ambiguous subscript with base type '[Event<E> : [Transition<S> : [String : (event: E?, fromState: S, toState: S, userInfo: Any?) -> Bool?]]]' and index type '_'
- NOTE | xcodebuild: Swift.Dictionary:261:12: note: found this candidate
- NOTE | xcodebuild: Swift.Dictionary:306:12: note: found this candidate
- NOTE | xcodebuild: Swift.Collection:25:12: note: found this candidate
- NOTE | xcodebuild: Swift.Indexable:23:12: note: found this candidate
- NOTE | xcodebuild: Swift.Indexable:45:12: note: found this candidate
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:190:42: error: missing argument label 'event:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:217:79: error: ambiguous subscript with base type '[Event<E> : [_HandlerInfo<S, E>]]' and index type '_'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:259:54: error: type 'Event<E>' has no member 'Any'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:284:32: error: missing argument label '_routeID:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:363:36: error: assigning non-escaping parameter 'routeMapping' to an @escaping closure
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:359:33: note: parameter 'routeMapping' is implicitly non-escaping
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:368:39: error: missing argument label 'routeMappingID:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:376:52: error: missing argument label 'routeMapping:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:378:58: error: type 'Event<_>' has no member 'Any'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:427:58: error: binary operator '==' cannot be applied to operands of type 'Event<E>' and '_'
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:427:58: note: overloads for '==' exist with these partially matching parameter lists: (Event<E>, Event<E>), (Event<E>, E), (T, T), (Self, Self)
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:447:49: error: cannot convert value of type 'Event<E>' to expected argument type 'Event<_>?'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:466:34: error: missing argument label 'handlerID:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:507:22: error: missing argument label 'event:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:513:21: error: missing argument label 'event:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:535:54: error: missing argument label 'upperBound:' in call
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:543:19: error: cannot convert value of type 'Transition<S>' to expected element type 'Transition<_>'
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:380:42: error: closure use of non-escaping parameter 'routeMapping' may allow it to escape
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:374:33: note: parameter 'routeMapping' is implicitly non-escaping
- ERROR | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:386:13: error: closure use of non-escaping parameter 'handler' may allow it to escape
- NOTE | [iOS] xcodebuild: SwiftState/Sources/Machine.swift:374:98: note: parameter 'handler' is implicitly non-escaping

所以 pod spec 文件似乎没有正确获取 pod 文件信息,关于 repo 和分支。

我错过了什么吗?

非常感谢。

最佳答案

Cocoapods 不允许用户使用s.dependency 语法指定分支。

解决方案:

  • 请作者正式发布swift/3.0分支
  • 或者您可以将以下行放在 Podfile 中使用私有(private) pod 的地方
    pod 'SwiftState', :git=> 'https://github.com/ReactKit/SwiftState.git', :branch => 'swift/3.0'

关于ios - Pod 规范依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40742085/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com