首页 > 解决方案 > flutter 和 firebase_messaging - 如何修复极值缓慢构建?

问题描述

我在我的颤振应用程序中添加了 firebase_messaging 包。构建应用程序后非常缓慢 - 12-14 分钟。虽然在 XCode 中它要快得多(大约 1-2 分钟)。我找到了这个解决方案。我尝试使用 irestore-ios-sdk-frameworks,但是在构建应用程序和结果错误时我有很多警告:

  `"std::__1::thread::hardware_concurrency()", referenced from:
      firebase::firestore::local::LevelDbRemoteDocumentCache::LevelDbRemoteDocumentCache(firebase::firestore::local::LevelDbPersistence*, firebase::firestore::local::LocalSerializer*) in
      FirebaseFirestore(leveldb_remote_document_cache.o)
  "___gxx_personality_v0", referenced from:
      -[FIRCollectionReference initWithPath:firestore:] in FirebaseFirestore(FIRCollectionReference.o)
      -[FIRCollectionReference initWithQuery:] in FirebaseFirestore(FIRCollectionReference.o)
      -[FIRCollectionReference isEqual:] in FirebaseFirestore(FIRCollectionReference.o)
      -[FIRCollectionReference isEqualToReference:] in FirebaseFirestore(FIRCollectionReference.o)
      absl::lts_2020_02_25::string_view::string_view<std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in FirebaseFirestore(FIRCollectionReference.o)
      -[FIRCollectionReference parent] in FirebaseFirestore(FIRCollectionReference.o)
      -[FIRCollectionReference path] in FirebaseFirestore(FIRCollectionReference.o)
      ...
  "___cxa_free_exception", referenced from:
      std::__1::__throw_length_error(char const*) in FirebaseFirestore(FIRDocumentSnapshot.o)
      std::__1::__throw_length_error(char const*) in FirebaseFirestore(FIRFieldPath.o)
      std::__1::__throw_length_error(char const*) in FirebaseFirestore(FIRQuery.o)
      std::__1::__throw_length_error(char const*) in FirebaseFirestore(FSTUserDataConverter.o)
      std::__1::__throw_length_error(char const*) in FirebaseFirestore(write_batch.o)
      std::__1::__throw_length_error(char const*) in FirebaseFirestore(query_snapshot.o)
      std::__1::__throw_future_error(std::__1::future_errc) in FirebaseFirestore(document_reference.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Encountered error while building for device.`

我使用这个包:

 `firebase_messaging: ^7.0.3`

这是我对 pod 文件的更改:

pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '7.3.0'

也许是版本不匹配的原因?有什么建议吗?

标签: iosfirebaseflutterfirebase-cloud-messaging

解决方案


推荐阅读