Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter iOS Command CompileSwift failed with a nonzero exit code

enter image description hereUncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code

Swift Compiler Error (Xcode): Cannot convert value of type 'UnsafeRawPointer' to expected argument type 'UnsafePointer<pb_byte_t>?' (aka 'Optional<UnsafePointer>') /Users/nex3012/Dev/flutterProjects/Fudosan/fudosan-calendar-application/ios/Pods/FirebaseS essions/FirebaseSessions/Sources/SessionStartEvent.swift:191:55

I tried to add firebase_crashlytics in my flutter project. it throws error in iOS when compiling.

Failed to build iOS app Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code

Swift Compiler Error (Xcode): Cannot convert value of type 'UnsafeRawPointer' to expected argument type 'UnsafePointer<pb_byte_t>?' (aka 'Optional<UnsafePointer>') /Users/nex3012/Dev/flutterProjects/Fudosan/fudosan-calendar-application/ios/Pods/FirebaseS essions/FirebaseSessions/Sources/SessionStartEvent.swift:191:55

like image 280
MURALI THANGAVEL Avatar asked Oct 15 '25 23:10

MURALI THANGAVEL


1 Answers

I fixed this issue by finding the issue in the Swift dependency and changing the offending line from:

let bytes = (transportBytes as NSData).bytes

TO

let bytes = (transportBytes as NSData).bytes.bindMemory(to: pb_byte_t.self, capacity: transportBytes.count)

like image 128
Rob Caraway Avatar answered Oct 17 '25 14:10

Rob Caraway



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!