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'
的上一段代码引起评论这些错误本身就说明了一切。但是,如果这是真的,为什么应用程序在模拟器中编译并运行良好?我怎样才能让它在我的设备上编译和运行呢?