缺少firebase_core / FirebaseCorePlugin.h

问题描述 投票:0回答:1

尝试运行flutter时出现以下错误:

Launching lib/main.dart on iPhone XR in debug mode...
Running pod install...                                              2.2s
                                                                                                                                                                                                           ├─Assembling Flutter resources...                           1.8s                                                                                             
 └─Compiling, linking and signing...                         4.3s
Xcode build done.                                           10.0s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    /Users/me/Downloads/myapp2/my_app/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'firebase_core/FirebaseCorePlugin.h' file not found
    #import <firebase_core/FirebaseCorePlugin.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

Could not build the application for the simulator.
Error launching application on iPhone XR.

flutter doctor说一切都是正确的,我已经运行了flutter packages get,将频道改为dev,我尝试了删除podspec.lockPodfile.lock的各种迭代,但没有运气。虽然我无法在我的应用程序中的任何位置看到此文件,但我可以在firebase_core git repo中看到它。有什么地方我可以手动放置它吗?

firebase flutter flutter-dependencies
1个回答
0
投票

如何解决这个问题:

  1. 重新安装Flutter到一个新目录
  2. 改为测试版flutter channel beta
  3. 创建了一个新的应用程序
  4. 在我的pubspec.yaml文件中,将链接设置为git(https://github.com/flutter/plugins/blob/master/FlutterFire.md)中提供的最新firebase_core版本。
dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^0.3.1  # add dependency for Firebase Core
  1. Ran flutter packages get
  2. 在ios文件夹中,运行pod install
© www.soinside.com 2019 - 2024. All rights reserved.