【问题标题】:Error running flutter project using Firebase Database使用 Firebase 数据库运行颤振项目时出错
【发布时间】:2021-04-29 20:32:09
【问题描述】:

firebase_database: ^7.0.0-dev.2 添加到我的项目后,我一直遇到这个问题。我还在 GitHub、S/O 和 Flutter 存储库上查看了其他问题,但没有成功。

我尝试过的一些故障排除尝试包括:

  1. 删除pod文件、PodfilePodfile.lock
  2. 正在运行 flutter cleanflutter pub get
  3. 正在运行pod install

我创建了一个新的颤振项目并将firebase_core: ^1.1.0firebase_database: ^7.0.0-dev.2 添加到pubspec.yaml。因此,我知道问题不是因为与我项目中其他颤振包的依赖冲突。

这是我尝试在模拟器上运行时调试日志的输出:

Launching lib/main.dart on iPad Pro (12.9-inch) (2nd generation) in debug mode...
Running pod install...                                           1,832ms
Running Xcode build...                                                  
Xcode build done.                                            3.4s
Failed to build iOS app
Error output from Xcode build:
↳
    objc[4399]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1f1f7c188) and ?? (0x117eb02b8). One of the two will be used. Which one is undefined.
    objc[4399]: Class AMSupportURLSession is implemented in both ?? (0x1f1f7c1d8) and ?? (0x117eb0308). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **

Xcode's output:
↳
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Realtime/FWebSocketConnection.m:22:9: fatal error:
    'FirebaseCore/Sources/Private/FirebaseCoreInternal.h' file not found
    #import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Realtime/FWebSocketConnection.m:22:9: note: did not find header
    'Sources/Private/FirebaseCoreInternal.h' in framework 'FirebaseCore' (loaded from '/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/build/ios/Debug-iphonesimulator/FirebaseCore')
    1 error generated.
    In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/View/FView.m:18:
    In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Api/Private/FIRDatabaseQuery_Private.h:19:
    In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/FRepo.h:17:
    In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/FPersistentConnection.h:19:
    In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Realtime/FConnection.h:17:
    In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Realtime/FWebSocketConnection.h:17:
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Utilities/FUtilities.h:17:9: fatal error: 'FirebaseCore/Sources/Private/FirebaseCoreInternal.h'
    file not found
    #import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Utilities/FUtilities.h:17:9: note: did not find header 'Sources/Private/FirebaseCoreInternal.h'
    in framework 'FirebaseCore' (loaded from '/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/build/ios/Debug-iphonesimulator/FirebaseCore')
    1 error generated.
    In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/FValueIndex.m:21:
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Utilities/FUtilities.h:17:9: fatal error: 'FirebaseCore/Sources/Private/FirebaseCoreInternal.h'
    file not found
    #import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Utilities/FUtilities.h:17:9: note: did not find header 'Sources/Private/FirebaseCoreInternal.h'
    in framework 'FirebaseCore' (loaded from '/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/build/ios/Debug-iphonesimulator/FirebaseCore')
    1 error generated.
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/View/FValueEventRegistration.m:18:9: fatal error:
    'FirebaseCore/Sources/Private/FirebaseCoreInternal.h' file not found
    #import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/View/FValueEventRegistration.m:18:9: note: did not find header
    'Sources/Private/FirebaseCoreInternal.h' in framework 'FirebaseCore' (loaded from '/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/build/ios/Debug-iphonesimulator/FirebaseCore')
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
    deployment target versions is 9.0 to 14.5.99. (in target 'leveldb-library' from project 'Pods')
    /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
    deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')

Could not build the application for the simulator.
Error launching application on iPad Pro (12.9-inch) (2nd generation).

【问题讨论】:

  • 你有没有尝试增加你的部署目标?
  • 是的,我阅读了文档以将其增加到版本 10。
  • 在每个地方都增加了它?甚至在 pod 中?
  • 是的,在 Runner 目标和 Pods 目标中。这是通过 XCode 完成的。

标签: firebase flutter


【解决方案1】:

暂时找到了解决方法:

firebase_core 删除到版本"0.7.0"firebase_database^6.0.0

【讨论】:

    猜你喜欢
    • 2018-11-01
    • 2023-03-13
    • 2021-03-18
    • 2020-02-20
    • 2020-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多