grpc / grpc-swift

The Swift language implementation of gRPC.
Apache License 2.0
2k stars 413 forks source link

Failed to build on XCode 12 on SwiftUI #1049

Closed BulatMukhutdinov closed 3 years ago

BulatMukhutdinov commented 3 years ago

Describe the bug

When using PreviewProvider with SwiftUI it fails with could not find module 'GRPC' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64.

XCode version: 12.2 MacOS version: 10.15.7 gRPC Swift version: 1.0.0-alpha.20 swift-protobuf version: 1.13.0

To reproduce

class Auth_Previews: PreviewProvider {

static var previews: some View {
    Group {
        AuthView()
            .previewDevice(PreviewDevice(rawValue: "iPhone SE"))
            .previewDisplayName("iPhone SE")

        AuthView()
            .previewDevice(PreviewDevice(rawValue: "iPhone 11 Pro"))
            .previewDisplayName("iPhone 11 Pro")
    }
}

}

Lukasa commented 3 years ago

This is likely to be an Xcode issue: grpc doesn't do anything specific here, and there has been issues with Xcode and Swift packages in SwiftUI previews in the past.