Flutter iOS平台Realm安装失败问题求助
Flutter + Realm iOS 安装报错:静态与动态框架冲突
我们几周前启动了一个Flutter项目,计划用Realm做本地存储,但在iOS模拟器和真机上都无法正常运行。
环境配置
- Flutter 3.16.7(stable通道)
- Dart 3.2.4
- pubspec.yaml中依赖:
realm: ^1.6.1
问题详情
Realm在Android平台运行正常,但更新Pods后iOS端安装失败,报错信息如下:
Updating local specs repositories CocoaPods 1.14.3 is available. To update use: `sudo gem install cocoapods` For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.14.3 Analyzing dependencies firebase_auth: Using Firebase SDK version '10.18.0' defined in 'firebase_core' firebase_core: Using Firebase SDK version '10.18.0' defined in 'firebase_core' firebase_messaging: Using Firebase SDK version '10.18.0' defined in 'firebase_core' project dir is /Users/agusampietro/GitHub/Dems/app/dems_mobile/ios app dir is /Users/agusampietro/GitHub/Dems/app/dems_mobile bundleId is dems_mobile Downloading dependencies Installing AppAuth (1.6.2) Installing Firebase (10.18.0) Installing FirebaseAppCheckInterop (10.19.0) Installing FirebaseAuth (10.18.0) Installing FirebaseCore (10.18.0) Installing FirebaseCoreInternal (10.19.0) Installing FirebaseInstallations (10.19.0) Installing FirebaseMessaging (10.18.0) Installing Flutter (1.0.0) Installing GTMAppAuth (2.0.0) Installing GTMSessionFetcher (3.2.0) Installing GoogleDataTransport (9.3.0) Installing GoogleSignIn (7.0.0) Installing GoogleUtilities (7.12.0) Installing PromisesObjC (2.3.1) Installing RecaptchaInterop (100.0.0) Installing firebase_auth (4.16.0) Installing firebase_core (2.24.2) Installing firebase_messaging (14.7.10) Installing flutter_native_timezone (0.0.1) Installing flutter_share (0.0.1) Installing geolocator_apple (1.2.0) Installing google_sign_in_ios (0.0.1) Installing nanopb (2.30909.1) Installing path_provider_foundation (0.0.1) Installing permission_handler_apple (9.1.1) Installing realm (1.6.1) Installing shared_preferences_foundation (0.0.1) Installing the_apple_sign_in (1.0.0) Generating Pods project [!] Unable to install vendored xcframework `realm_dart` for Pod `realm`, because it contains both static and dynamic frameworks.
已尝试的解决办法
- 清理Flutter项目缓存
- 删除Podfile、Podfile.lock及Pods目录后重新执行pod install
- 更新Xcode到最新版本
- 更新Flutter到当前stable版本
- 更新CocoaPods到1.14.3版本
尝试过以上方法后问题仍未解决,求有相关经验的开发者帮忙指点。
内容的提问来源于stack exchange,提问作者dksr
相关产品推荐
相关产品推荐

