skip to Main Content

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


  1. Chosen as BEST ANSWER

    I fixed the Firebase dependencies and it worked. 10.0.0 → 9.6.0

    pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '9.6.0'
    
      cloud_firestore: ^3.4.3
      cloud_functions: ^3.3.3
      firebase_analytics: ^9.3.0
      firebase_auth: ^3.6.2
      firebase_core: ^1.20.0
      firebase_crashlytics: ^2.8.6
      firebase_dynamic_links: ^4.3.3
      firebase_messaging: ^12.0.1
      firebase_storage: ^10.3.4
      firebase_remote_config: ^2.0.13
    

  2. Issue is documented on GitHub: https://github.com/firebase/flutterfire/issues/9806

    The root of the issue is firebase_core_platform_interface version 4.5.2 introducing breaking changes and the other firebase packages use firebase_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

    dependency_overrides:
      firebase_core_platform_interface: 4.5.1
    

    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

    firebase_auth: 4.1.0
    firebase_core: 2.1.1
    firebase_dynamic_links: 5.0.3
    cloud_firestore: 4.0.3
    firebase_storage: 11.0.3
    firebase_messaging: 14.0.3
    cloud_functions: 4.0.3
    

    Following making these changes you can start fresh by running
    flutter clean and flutter 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 removed pod 'FirebaseFirestore'
    And I had to set the Firebase dependencies to these specific versions instead

    firebase_core: 2.1.0
    firebase_auth: 4.0.2
    cloud_firestore: 4.0.2
    cloud_functions: 4.0.2
    firebase_storage: 11.0.2
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search