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.69k stars 3.97k forks source link

cloud_firestore: build error when including cloud_firestore: Undefined symbol: absl..... #13568

Closed chris-gunawardena closed 2 hours ago

chris-gunawardena commented 2 hours ago

Is there an existing issue for this?

Which plugins are affected?

Storage

Which platforms are affected?

iOS

Description

When adding firebase cloud_firestore to pubspec.yaml to a new flutter scaffold, get a compile/build error " Undefined symbol: absl."

I'm on MacOS 14.7 on a M3.

I've already tried:

Reproducing the issue

  1. Create a new flutter app from VS Code.
  2. Add firebase to it. Works fine with just firebase_core.
  3. Add cloud_firestore: ^5.4.4 as dependency to pubspec.yaml and build will start failing with the error below

Example project: https://github.com/chris-gunawardena/ff-issue-example-code

Firebase Core version

3.6.0

Flutter Version

3.24.4

Relevant Log Output

➜  flutter_application_1 git:(master) ✗ flutter pub get      
Resolving dependencies... 
Downloading packages... 
  async 2.11.0 (2.12.0 available)
  boolean_selector 2.1.1 (2.1.2 available)
  characters 1.3.0 (1.3.1 available)
  clock 1.1.1 (1.1.2 available)
  collection 1.18.0 (1.19.1 available)
  fake_async 1.3.1 (1.3.2 available)
  flutter_lints 4.0.0 (5.0.0 available)
  leak_tracker 10.0.5 (10.0.8 available)
  leak_tracker_flutter_testing 3.0.5 (3.0.9 available)
  lints 4.0.0 (5.1.0 available)
  matcher 0.12.16+1 (0.12.17 available)
  material_color_utilities 0.11.1 (0.12.0 available)
  meta 1.15.0 (1.16.0 available)
  path 1.9.0 (1.9.1 available)
  stack_trace 1.11.1 (1.12.0 available)
  string_scanner 1.2.0 (1.4.0 available)
  test_api 0.7.2 (0.7.3 available)
  vm_service 14.2.5 (14.3.1 available)
Got dependencies!
18 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
➜  flutter_application_1 git:(master) ✗ cd ios
➜  ios git:(master) ✗ pod install
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '11.2.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '11.2.0' defined in 'firebase_core'
Downloading dependencies
Installing BoringSSL-GRPC (0.0.36)
Installing Firebase (11.2.0)
Installing FirebaseAppCheckInterop (11.4.0)
Installing FirebaseCore (11.2.0)
Installing FirebaseCoreExtension (11.4.1)
Installing FirebaseCoreInternal (11.4.2)
Installing FirebaseFirestore (11.2.0)
Installing FirebaseFirestoreInternal (11.2.0)
Installing FirebaseSharedSwift (11.4.0)
Installing Flutter (1.0.0)
Installing GoogleUtilities (8.0.2)
Installing abseil (1.20240116.2)
Installing cloud_firestore (5.4.4)
Installing firebase_core (3.6.0)
Installing gRPC-C++ (1.65.5)
Installing gRPC-Core (1.65.5)
Installing leveldb-library (1.22.6)
Installing nanopb (3.30910.0)
Generating Pods project
Integrating client project
Pod installation complete! There are 3 dependencies from the Podfile and 18 total pods installed.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).

➜  ios git:(master) ✗ cd ..                  
➜  flutter_application_1 git:(master) ✗ flutter run
Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
Running pod install...                                             15.7s
Running Xcode build...                                                  
Xcode build done.                                           219.1s
Failed to build iOS app
Error (Xcode): Undefined symbol: absl::lts_20240116::CHexEscape(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::FormatTime(absl::lts_20240116::string_view, absl::lts_20240116::Time, absl::lts_20240116::TimeZone)

Error (Xcode): Undefined symbol: absl::lts_20240116::SimpleAtof(absl::lts_20240116::string_view, float*)

Error (Xcode): Undefined symbol: absl::lts_20240116::Base64Escape(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::UnknownError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::log_internal::LogMessage::AtLocation(absl::lts_20240116::string_view, int)

Error (Xcode): Undefined symbol: void absl::lts_20240116::log_internal::LogMessage::CopyToEncodedBuffer<(absl::lts_20240116::log_internal::LogMessage::StringType)0>(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: void absl::lts_20240116::log_internal::LogMessage::CopyToEncodedBuffer<(absl::lts_20240116::log_internal::LogMessage::StringType)1>(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::log_internal::LogMessage::operator<<(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::log_internal::PrependVModule(absl::lts_20240116::string_view, int)

Error (Xcode): Undefined symbol: absl::lts_20240116::log_internal::LogMessageFatal::LogMessageFatal(char const*, int, absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::InternalError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::NotFoundError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::StrReplaceAll(absl::lts_20240116::string_view, std::initializer_list<std::__1::pair<absl::lts_20240116::string_view, absl::lts_20240116::string_view>>)

Error (Xcode): Undefined symbol: absl::lts_20240116::Base64Unescape(absl::lts_20240116::string_view, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)

Error (Xcode): Undefined symbol: absl::lts_20240116::CancelledError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::flags_internal::AbslParseFlag(absl::lts_20240116::string_view, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*,
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)

Error (Xcode): Undefined symbol: absl::lts_20240116::flags_internal::AbslParseFlag(absl::lts_20240116::string_view, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>,
std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)

Error (Xcode): Undefined symbol: absl::lts_20240116::flags_internal::AbslParseFlag(absl::lts_20240116::string_view, bool*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)

Error (Xcode): Undefined symbol: absl::lts_20240116::flags_internal::AbslParseFlag(absl::lts_20240116::string_view, int*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)

Error (Xcode): Undefined symbol: absl::lts_20240116::flags_internal::AbslUnparseFlag(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::status_internal::StatusRep::SetPayload(absl::lts_20240116::string_view, absl::lts_20240116::Cord)

Error (Xcode): Undefined symbol: absl::lts_20240116::BytesToHexString(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::EqualsIgnoreCase(absl::lts_20240116::string_view, absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::UnavailableError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::numbers_internal::safe_strto32_base(absl::lts_20240116::string_view, int*, int)

Error (Xcode): Undefined symbol: absl::lts_20240116::numbers_internal::safe_strto64_base(absl::lts_20240116::string_view, long long*, int)

Error (Xcode): Undefined symbol: absl::lts_20240116::numbers_internal::safe_strtou32_base(absl::lts_20240116::string_view, unsigned int*, int)

Error (Xcode): Undefined symbol: absl::lts_20240116::numbers_internal::safe_strtou64_base(absl::lts_20240116::string_view, unsigned long long*, int)

Error (Xcode): Undefined symbol: absl::lts_20240116::strings_internal::AppendPieces(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*,
std::initializer_list<absl::lts_20240116::string_view>)

Error (Xcode): Undefined symbol: absl::lts_20240116::strings_internal::StringifySink::Append(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::strings_internal::CatPieces(std::initializer_list<absl::lts_20240116::string_view>)

Error (Xcode): Undefined symbol: absl::lts_20240116::variant_internal::ThrowBadVariantAccess()

Error (Xcode): Undefined symbol: absl::lts_20240116::EndsWithIgnoreCase(absl::lts_20240116::string_view, absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::UnimplementedError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::WebSafeBase64Escape(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: bool absl::lts_20240116::str_format_internal::FormatArgImpl::Dispatch<absl::lts_20240116::string_view>(absl::lts_20240116::str_format_internal::FormatArgImpl::Data,
absl::lts_20240116::str_format_internal::FormatConversionSpecImpl, void*)

Error (Xcode): Undefined symbol: absl::lts_20240116::InvalidArgumentError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::StartsWithIgnoreCase(absl::lts_20240116::string_view, absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::UnauthenticatedError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::DeadlineExceededError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::PermissionDeniedError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::WebSafeBase64Unescape(absl::lts_20240116::string_view, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)

Error (Xcode): Undefined symbol: absl::lts_20240116::ResourceExhaustedError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::FailedPreconditionError(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::Cord::GetFlatAux(absl::lts_20240116::cord_internal::CordRep*, absl::lts_20240116::string_view*)

Error (Xcode): Undefined symbol: absl::lts_20240116::Cord::InlineRep::AppendArray(absl::lts_20240116::string_view, absl::lts_20240116::cord_internal::CordzUpdateTracker::MethodIdentifier)

Error (Xcode): Undefined symbol: absl::lts_20240116::Cord::Cord(absl::lts_20240116::string_view, absl::lts_20240116::cord_internal::CordzUpdateTracker::MethodIdentifier)

Error (Xcode): Undefined symbol: absl::lts_20240116::Status::Status(absl::lts_20240116::StatusCode, absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::CEscape(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::ByString::ByString(absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::CUnescape(absl::lts_20240116::string_view, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char>>*)

Error (Xcode): Undefined symbol: absl::lts_20240116::ParseTime(absl::lts_20240116::string_view, absl::lts_20240116::string_view, absl::lts_20240116::Time*, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char>>*)

Error (Xcode): Undefined symbol: absl::lts_20240116::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, absl::lts_20240116::string_view)

Error (Xcode): Undefined symbol: absl::lts_20240116::string_view::find_first_of(absl::lts_20240116::string_view, unsigned long) const

Error (Xcode): Undefined symbol: absl::lts_20240116::string_view::find(absl::lts_20240116::string_view, unsigned long) const

Error (Xcode): Undefined symbol: absl::lts_20240116::string_view::find(char, unsigned long) const

Error (Xcode): Undefined symbol: absl::lts_20240116::string_view::rfind(char, unsigned long) const

Error (Xcode): Undefined symbol: absl::lts_20240116::status_internal::StatusRep::GetPayload(absl::lts_20240116::string_view) const

Error (Xcode): Undefined symbol: absl::lts_20240116::status_internal::StatusRep::ForEachPayload(absl::lts_20240116::FunctionRef<void (absl::lts_20240116::string_view, absl::lts_20240116::Cord const&)>) const

Error (Xcode): Undefined symbol: absl::lts_20240116::ByChar::Find(absl::lts_20240116::string_view, unsigned long) const

Error (Xcode): Undefined symbol: absl::lts_20240116::ByString::Find(absl::lts_20240116::string_view, unsigned long) const

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro Max.

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Dart SDK 3.5.4 Flutter SDK 3.24.4 flutter_application_1 0.1.0 dependencies: - cloud_firestore 5.4.4 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - firebase_core 3.6.0 [firebase_core_platform_interface firebase_core_web flutter meta] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] - intl 0.19.0 [clock meta path] 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.44 [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 - cloud_firestore_platform_interface 6.4.3 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 4.3.2 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins] - collection 1.18.0 - fake_async 1.3.1 [clock collection] - firebase_core_platform_interface 5.3.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.18.1 [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.1.0 ```

Additional context and comments

➜ flutter_application_1 git:(master) ✗ flutter --version Flutter 3.24.4 • channel stable • https://github.com/flutter/flutter.git Framework • revision 603104015d (6 days ago) • 2024-10-24 08:01:25 -0700 Engine • revision db49896cf2 Tools • Dart 3.5.4 • DevTools 2.37.3 ➜ flutter_application_1 git:(master) ✗ ruby -v ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [arm64-darwin23] ➜ flutter_application_1 git:(master) ✗ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.24.4, on macOS 14.7 23H124 darwin-arm64, locale en-US) [✗] Android toolchain - develop for Android devices ✗ cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest" See https://developer.android.com/studio/command-line for more details. [✓] Xcode - develop for iOS and macOS (Xcode 16.1) [✓] Chrome - develop for the web [!] Android Studio (not installed) [✓] IntelliJ IDEA Ultimate Edition (version 2024.2.3) [✓] VS Code (version 1.94.2) [✓] Connected device (5 available)
[✓] Network resources

! Doctor found issues in 2 categories. ➜ flutter_application_1 git:(master) ✗ pod --version 1.16.0 ➜ flutter_application_1 git:(master) ✗ xcodebuild -version Xcode 16.1 Build version 16B40

chris-gunawardena commented 2 hours ago

Same as 13563