升级firebase核心后flutter Ios构建失败

Yog*_*esh 6 ios firebase flutter

我有一个 Flutter 应用程序,它在 firebase 核心(版本0.4.0)上运行良好。我将 firebase_core 升级到版本0.5.0并根据迁移进行了所有更改。在 ios 构建之后出现以下错误

Launching lib/main.dart on iPhone SE (2nd generation) in debug mode...
 
Running Xcode build...                                                  
                                                   
Xcode build done.                                           95.9s
Failed to build iOS app
Error output from Xcode build:
?
    AssertMacros: amdErr = AMDeviceConnect(tmpDevice) == 0 ,  file:
    /BuildRoot/Library/Caches/com.apple.xbs/Sources/MobileDevice/MobileDevice-1190.100.2.1/Source/AMDevicePowerAssertion.c, line: 224, value: -402653083
    ** BUILD FAILED **


Xcode's output:
?
    <module-includes>:1:1: error: umbrella header for module 'GoogleUtilities' does not include header 'GULLoggerCodes.h' [-Werror,-Wincomplete-umbrella]
    #import "Headers/GoogleUtilities-umbrella.h"
    ^
    1 error generated.
    In file included from /Users/yogesh/projects/mobile-flutter/ios/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m:24:
    /Users/yogesh/projects/mobile-flutter/ios/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Logger/Private/GULLogger.h:22:9: fatal error: could not build module
    'GoogleUtilities'
    #import <GoogleUtilities/GULLoggerLevel.h>
     ~~~~~~~^
    2 errors generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
Run Code Online (Sandbox Code Playgroud)

它在 android 中运行良好,甚至从 xcode 构建 ios 构建也可以正常工作。它从失败的命令行构建和运行 ( flutter run)

以下是我的 pubspec 文件,其中包含 Firebase 依赖项

dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^0.5.0
  firebase_auth: ^0.18.0+1
  cloud_firestore: ^0.14.0+2
  sqflite:
  path:
  progress_dialog: ^1.2.4
Run Code Online (Sandbox Code Playgroud)

我无法理解是因为库错误还是我这边的某些原因,因为它似乎是 lib 错误,但是从 xcode 构建的 android 和 ios 完全正常。

小智 13

运行命令

扑干净

然后重新运行该应用程序对我有用。


小智 6

我刚刚遇到了同样的问题,因为我能够从 XCode Runner 运行该应用程序,但不能从具有相同错误消息的 Android Studio 中运行。我设法通过以下步骤解决了这个问题:

  1. 添加firebase_analytics: ^6.0.0到 pubspec.yaml。
  2. 然后删除PodfilePodfile.lock
  3. 最后再次运行它。

但是我不能告诉你为什么它解决了这个问题,所以不能真正保证这对你有用。