flutter (Xcode):未定义的符号:级别数据库::写入批处理::放置(级别数据库::切片常量&,级别数据库::切片常量&)错误

bf1o4zei  于 2022-12-24  发布在  Flutter
关注(0)|答案(1)|浏览(114)

我有Flutter移动的应用程序与Firebase。今天每次我运行“Flutter运行”命令在真实的的iPhone 14 Pro移动设备上,我看到以下错误。这是从来没有过的情况。

Could not build the precompiled application for the device.
Error (Xcode): Undefined symbol: leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)

Error (Xcode): Undefined symbol: leveldb::WriteBatch::Delete(leveldb::Slice const&)

Error (Xcode): Undefined symbol: leveldb::WriteBatch::WriteBatch()

Error (Xcode): Undefined symbol: leveldb::WriteBatch::~WriteBatch()

Error (Xcode): Undefined symbol: leveldb::DB::Open(leveldb::Options const&, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::DB**)

Error (Xcode): Undefined symbol: leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&,
leveldb::Slice const&)

Error (Xcode): Undefined symbol: leveldb::Options::Options()

Error (Xcode): Undefined symbol: leveldb::Status::ToString() const

有人知道问题出在哪里吗?
下面是我的pubspec.yaml文件的外观:

version: 1.1.1+18
publish_to: none

environment:
  sdk: '>=2.18.6 <3.0.0'
  flutter: 3.3.8

dependencies:
  android_id: ^0.1.3+1
  badges: ^2.0.3
  cached_network_image: ^3.2.3
  carousel_slider: ^4.2.0
  cloud_firestore: ^4.2.0
  cloud_functions: ^4.0.6
  connectivity_plus: ^3.0.2
  device_info_plus: ^8.0.0
  dotted_border: ^2.0.0+3
  firebase_app_check: ^0.1.1+6
  firebase_auth: ^4.1.5
  firebase_core: ^2.3.0
  firebase_dynamic_links: ^5.0.8
  firebase_messaging: ^14.1.4
  firebase_remote_config: ^3.0.7
  firebase_storage: ^11.0.7
  firebase_ui_firestore: ^1.1.1
  flash: ^2.0.5
  flutter:
    sdk: flutter
  flutter_dotenv: ^5.0.2
  flutter_facebook_auth: 4.4.1
  flutter_hooks: ^0.18.5+1
  flutter_image_compress: ^1.1.3
  flutter_launcher_icons: ^0.11.0
  flutter_local_notifications: ^13.0.0
  flutter_localizations:
    sdk: flutter
  flutter_slidable: ^2.0.0
  flutter_svg: ^1.1.6
  geocoding: ^2.0.5
  geolocator: ^9.0.2
  google_fonts: ^3.0.1
  google_sign_in: ^5.4.2
  hooks_riverpod: ^2.1.1
  http: ^0.13.5
  image_cropper: ^3.0.1
  image_picker: ^0.8.6
  intl: ^0.17.0
  linkable: ^3.0.1
  material_design_icons_flutter: ^6.0.7096
  open_mail_app: ^0.4.5
  package_info_plus: ^3.0.2
  path_provider: ^2.0.11
  pattern_formatter: ^2.0.0
  permission_handler: ^10.2.0
  photo_view: ^0.14.0
  purchases_flutter: ^4.5.0
  rate_my_app: ^1.1.3
  share_plus: ^6.3.0
  shared_preferences: ^2.0.15
  shimmer: ^2.0.0
  store_redirect: ^2.0.1
  timeago: ^3.3.0
  tuple: ^2.0.1
  url_launcher: ^6.1.7
  uuid: ^3.0.7
  webview_flutter: ^4.0.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  mocktail: ^0.3.0
  very_good_analysis: ^3.1.0

flutter:
  uses-material-design: true
  generate: true
  assets:
    - assets/envs/
    - assets/email_icons/
    - assets/flags/
    - assets/images/
    - assets/json/
    - assets/social_icons/

请让我知道如何克服这个错误。

7rtdyuoh

7rtdyuoh1#

我找到了解决方案over here。我在我的Podfile“target 'Runner' do”中修改了这个块。下面是这个块的外观:

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  # use this line
  pod 'FirebaseFirestore/WithLeveldb', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '10.3.0'

  # not this line
  # pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '10.3.0'

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

评论行是我之前有的,我基本上把“FirebaseFirestore”改成了文档中提到的“FirebaseFirestore/WithLeveldb”。
希望这能帮到什么人。

相关问题