0
我在我的iOS應用程序中使用了github.com/apple/swift-protobuf tag 0.9.904和github.com/grpc/grpc-swift tag 0.1.12以及Xcode。我也用protoc來編譯我的.proto文件。協議緩衝區代碼爲iOS模擬器編譯但不是設備
的應用程序工作正常了iOS模擬器,但是當我嘗試在設備上運行的應用程序,我得到的生成代碼如下位編譯錯誤在myapp.pb.swift
:
// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that your are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}
的錯誤是
No type named 'ProtobufAPIVersion_2' in module 'SwiftProtobuf'
和
Type '_GeneratedWithProtocGenSwiftVersion' does not conform to protocol 'ProtobufAPIVersionCheck'
的上一段代碼引起評論這些錯誤本身就說明了一切。但是,如果這是真的,爲什麼應用程序在模擬器中編譯並運行良好?我怎樣才能讓它在我的設備上編譯和運行呢?