【问题标题】:Failed run flutter app on iOS Simulator on MacOS在 MacOS 上的 iOS 模拟器上运行颤振应用程序失败
【发布时间】:2020-03-03 16:36:54
【问题描述】:

我是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

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

【问题讨论】:

    标签: android firebase flutter dart


    【解决方案1】:

    我找到了这个github issue 2084 似乎很多人都在经历同样的事情。其中一个被引用的解决方案是回滚到旧版本的 firebase 依赖项。不要忘记在版本之前删除 ^ - 因为您不想接受较新的版本;在构建之前,您可能还需要flutter clean

    【讨论】:

      【解决方案2】:

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

      flutter clean
      
      flutter build ios
      

      (pod install) 如果需要

      【讨论】:

        【解决方案3】:

        Xcode 的输出: ↳

        /Users/pictuscode/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.4+2/darwin/Classes/FLTFirebaseCorePlugin.m:6:9:致命错误:'UserAgent.h '文件未找到

        我通过删除^ 解决了该错误。

        替换firebase_core: ^0.4.4+2

        firebase_core: 0.4.4 合作

        【讨论】:

          猜你喜欢
          • 2019-05-31
          • 2022-08-19
          • 2020-01-07
          • 2021-10-19
          • 2021-06-18
          • 1970-01-01
          • 2021-07-09
          • 2021-11-30
          • 2021-01-05
          相关资源
          最近更新 更多