firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.7k stars 3.97k forks source link

[Analytics]: ld: Undefined symbols: #13333

Closed bqubique closed 1 month ago

bqubique commented 1 month ago

Is there an existing issue for this?

Which plugins are affected?

Analytics

Which platforms are affected?

iOS

Description

Building with the latest packages results in Undefined Symbols on Xcode (flutter build ios -v).

Reproducing the issue

flutter create new_project

flutter pub add firebase_core

flutter pub add firebase_analytics

flutter build ios -v

Firebase Core version

3.4.1

Flutter Version

3.24.2

Relevant Log Output

ld: Undefined symbols:
                      static StoreKit.Transaction.Offer.PaymentMode.freeTrial.getter :
                      StoreKit.Transaction.Offer.PaymentMode, referenced from:
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                      type metadata accessor for StoreKit.Transaction.Offer.PaymentMode, referenced from:
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                      nominal type descriptor for StoreKit.Transaction.Offer.PaymentMode, referenced from:
                          _symbolic _____Sg 8StoreKit11TransactionV5OfferV11PaymentModeV in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                          _symbolic _____Sg_ABt 8StoreKit11TransactionV5OfferV11PaymentModeV in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                      protocol conformance descriptor for StoreKit.Transaction.Offer.PaymentMode : Swift.Equatable in
                      StoreKit, referenced from:
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                      StoreKit.Transaction.Offer.paymentMode.getter : StoreKit.Transaction.Offer.PaymentMode?,
                      referenced from:
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                      StoreKit.Transaction.Offer.type.getter : StoreKit.Transaction.OfferType, referenced from:
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                      type metadata accessor for StoreKit.Transaction.Offer, referenced from:
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                      nominal type descriptor for StoreKit.Transaction.Offer, referenced from:
                          _symbolic _____Sg 8StoreKit11TransactionV5OfferV in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                      StoreKit.Transaction.offer.getter : StoreKit.Transaction.Offer?, referenced from:
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                          static (extension in
                          FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in
                          FirebaseAnalytics[17](Analytics+StoreKit.o)
                    clang: error: linker command failed with exit code 1 (use -v to see invocation)

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Dart SDK 3.5.2 Flutter SDK 3.24.2 new_project 1.0.0+1 dependencies: - cupertino_icons 1.0.8 - firebase_analytics 11.3.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_core 3.4.1 [firebase_core_platform_interface firebase_core_web flutter meta] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] dev dependencies: - flutter_lints 4.0.0 [lints] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service] transitive dependencies: - _flutterfire_internals 1.3.42 [collection firebase_core firebase_core_platform_interface flutter meta] - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - characters 1.3.0 - clock 1.1.1 - collection 1.18.0 - fake_async 1.3.1 [clock collection] - firebase_analytics_platform_interface 4.2.3 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.10 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins] - firebase_core_platform_interface 5.2.1 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.18.0 [firebase_core_platform_interface flutter flutter_web_plugins meta web] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math] - leak_tracker 10.0.5 [clock collection meta path vm_service] - leak_tracker_flutter_testing 3.0.5 [flutter leak_tracker leak_tracker_testing matcher meta] - leak_tracker_testing 3.0.1 [leak_tracker matcher meta] - lints 4.0.0 - matcher 0.12.16+1 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.11.1 [collection] - meta 1.15.0 - path 1.9.0 - plugin_platform_interface 2.1.8 [meta] - sky_engine 0.0.99 - source_span 1.10.0 [collection path term_glyph] - stack_trace 1.11.1 [path] - stream_channel 2.1.2 [async] - string_scanner 1.2.0 [source_span] - term_glyph 1.2.1 - test_api 0.7.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - vector_math 2.1.4 - vm_service 14.2.5 - web 1.0.0 ```

Additional context and comments

No response

hafidzaini commented 1 month ago

same error, been 6 hour and still cant solve this issue 😰

ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
ld: Undefined symbols:
  static StoreKit.Transaction.Offer.PaymentMode.freeTrial.getter : StoreKit.Transaction.Offer.PaymentMode, referenced from:
      static (extension in FirebaseAnalytics):__C.FIRAnalytics.logTransaction(StoreKit.Transaction) -> () in FirebaseAnalytics[17](Analytics+StoreKit.o)
bqubique commented 1 month ago

@hafidzaini for now either downgrade you firebase dependencies or don't use analytics. That's my go-to solution temporarily.

hafidzaini commented 1 month ago

thanks for the info. it was working fine when building a week ago before i do flutter clean. didnt change any firebase plugin version 😰

hafidzaini commented 1 month ago

never change package version, this error happen after flutter clean. Solve this issue by update xCode to latest version, from 15.0 to 15.4

SelaseKay commented 1 month ago

Hi @bqubique , Have you tried updating your Xcode?

VarunS5 commented 1 month ago

Hi @bqubique

Updating the firebase packages to the following version, resolved the issue for me

firebase_remote_config: 5.0.0 firebase_analytics: 11.0.0 firebase_core: 3.0.0 firebase_crashlytics: 4.0.0

And to check the connectivity of firebase packages please verify the package compatibility in the following url https://github.com/firebase/flutterfire/blob/master/CHANGELOG.md

OR

Update the XCode version to 15.4

bqubique commented 1 month ago

I bit the bullet and updated my xcode to 16.0. It has resolved the issues with analytics. Thanks @hafidzaini!