I want to open the Swift screen from Flutter, but an error occurs and I can’t open it.
I am using FirebaseAnalytics in Swift screen.
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC0D16DecodingStrategyO6base64yA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC19KeyDecodingStrategyO14useDefaultKeysyA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC19keyDecodingStrategyAC03KeygH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC20DateDecodingStrategyO6customyAE10Foundation0F0Vs0E0_pKccAEmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC20dataDecodingStrategyAC0dgH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC20dateDecodingStrategyAC04DategH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC23passthroughTypeResolverAA026StructureCodingPassthroughgH0_pXpvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC34NonConformingFloatDecodingStrategyO5throwyA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC34nonConformingFloatDecodingStrategyAC03NonghiJ0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC6decode_4fromxxm_yptKSeRzlFTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataDecoderC8userInfoSDys010CodingUserG3KeyVypGvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC0D16EncodingStrategyO6base64yA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC19KeyEncodingStrategyO14useDefaultKeysyA2EmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC19keyEncodingStrategyAC03KeygH0OvsTj
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC20DateEncodingStrategyO6customyAEy10Foundation0F0V_s0E0_ptKccAEmFWC
Error (Xcode): Undefined symbol: _$s19FirebaseSharedSwift0A11DataEncoderC20dataEncodingStrategyAC0dgH0OvsTj
2
Answers
I fixed the Firebase dependencies and it worked. 10.0.0 → 9.6.0
Issue is documented on GitHub: https://github.com/firebase/flutterfire/issues/9806
The root of the issue is
firebase_core_platform_interface
version4.5.2
introducing breaking changes and the other firebase packages usefirebase_core_platform_interface
as a package dependency and are set to update minor version automatically and this minor version contained a breaking change.Some people seem to have luck with overriding a sub-dependency in pubspec.yaml
https://github.com/firebase/flutterfire/issues/9806#issuecomment-1294532006
You also might need to rollback/upgrade Firebase dependencies to line up with this change if you happen to use them
https://github.com/firebase/flutterfire/issues/9806#issuecomment-1294545363
Following making these changes you can start fresh by running
flutter clean
andflutter pub get
Random things I had to change to get it to work in addition to above was update Podfile to
platform :ios, '13.0'
and removedpod 'FirebaseFirestore'
And I had to set the Firebase dependencies to these specific versions instead