提问者:小点点

在MacOS上的iOS模拟器上运行flutter应用程序失败


我是flutter的初学者,我正在使用android studio创建我的flutter应用程序,我需要pubspec. yaml文件中的一些插件!

运行没有问题,但当我添加cloud_firestore,firebase_auth,firebase_storage,ImagePicker和fluttertoast我得到一个错误!

这是错误:

** BUILD FAILED **


Xcode's output:
↳

/Users/Mr.3bd/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.4+2/darwin/Classes/FLTFirebaseCorePlugin.m:6:9: fatal error: 'UserAgent.h' file not found
#import "UserAgent.h"
        ^~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning build
note: Constructing build description

warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform.(in target 'image_picker' from project 'Pods')
warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
warning: There are no architectures to compile for because the VALID_ARCHS build setting is an empty list. (in target 'Runner' from project 'Runner')
In file included from /Users/Mr.3bd/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-3.1.3/ios/Classes/UIView+Toast.m:26:
/Users/Mr.3bd/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.2.1/ios/Classes/SqflitePlugin.m:2:9: warning: non-portable path to file '<fmdb/FMDB.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#import <FMDB/FMDB.h>

我的pubspec. yaml文件:

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  firebase_auth: ^0.12.0
  cloud_firestore: ^0.12.0
  firebase_storage: ^3.1.0
  shared_preferences: ^0.5.4+6
  flutter_offline: ^0.3.0
  provider: ^3.1.0
  simple_animations: ^1.1.3
  page_transition: ^1.1.4
  cupertino_icons: ^0.1.3
  gradient_app_bar: ^0.0.1
  fluttertoast: ^3.1.1
  flutter_spinkit: ^4.0.0
  flutter_launcher_icons: ^0.7.3
  rflutter_alert: ^1.0.3
  url_launcher: ^4.1.0
  flutter_speed_dial: ^1.2.5
  image_picker: ^0.6.3+1
  file_picker: ^1.4.3+2
  validators: ^2.0.0+1
  dio: ^3.0.8
  flutter_plugin_pdf_viewer: ^1.0.7

任何人都可以帮助我并将插件版本更新为兼容版本!


共3个答案

匿名用户

我发现这个github问题2084,似乎很多人都在经历qouted解决方案的same.One是回滚到Firebase依赖项的旧版本。不要忘记在版本之前删除^-因为你不想接受较新的版本;在构建之前,您可能需要flutter清洁

匿名用户

我最近在我的项目中遇到了这种类型的问题,但没有解决方案

试试上面的设置,然后就可以了

转到Xcode-

清除派生数据清理构建文件夹并运行应用程序

请找到Snap以获得更多澄清

匿名用户

同样的事情也发生在我身上:

flutter clean

flutter build ios

pod install)如果需要