Xcode 构建失败,致命错误:找不到模块“firebase_auth”@import firebase_auth;

Alr*_*hir 8 macos xcode ios cocoapods flutter

    Doctor summary (to see all details, run flutter doctor -v):\n[\xe2\x9c\x93] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-US)\n[\xe2\x9c\x93] Android toolchain - develop for Android devices (Android SDK version 29.0.3)\n[\xe2\x9c\x93] Xcode - develop for iOS and macOS (Xcode 11.5)\n[\xe2\x9c\x93] Android Studio (version 4.0)\n[\xe2\x9c\x93] VS Code (version 1.46.1)\n[!] Connected device\n    ! No devices available\n\n! Doctor found issues in 1 category.\n
Run Code Online (Sandbox Code Playgroud)\n

\\\\\\错误信息

\n
     ** BUILD FAILED **\nXcode's output:\n\xe2\x86\xb3\n    /Users/Razi/Desktop/projects/Sayy/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'firebase_auth' not found\n    @import firebase_auth;\n     ~~~~~~~^~~~~~~~~~~~~\n    1 error generated.\n    note: Using new build system\n    note: Building targets in parallel\n    note: Planning build\n    note: Constructing build description\n
Run Code Online (Sandbox Code Playgroud)\n

我尝试删除 Podfile/Podlock 并运行pod init/pod install但没有成功。还查看了 ios 文件夹的 GitHub 存储库。为什么找不到 firebase_auth?

\n

Alr*_*hir 8

更新:我最终通过执行以下命令找到了解决方法:

  1. 运行Flutter Clean(在项目的ios文件夹中)
  2. 删除Podlock&Pod Folder
  3. 运行pod init后跟pod install

似乎是 runner.xcworkspace 文件夹和运行构建所需的构建文件存在问题。