【问题标题】:Firebase.h file not found with CocoaPodsCocoaPods 找不到 Firebase.h 文件
【发布时间】:2019-09-22 17:54:12
【问题描述】:

我正在尝试将 Firebase 添加到我的项目中。我刚刚在我的 Xcode 项目中添加了下面的 pod。

  pod 'Firebase'
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'
  pod 'Firebase/Database'
  pod 'Firebase/Auth'

安装 podfile 后,我尝试将 firebase 导入我的项目。但它给了我一个错误 Firebase.h is not found.

当我从[CP] Check pods Manifest.lock 中取消选中Run script only when installing 时,会出现上述问题。之后,我将使用pod install 安装 pod。然后就会出现问题。

取消选中复选框后出现的错误:

error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

【问题讨论】:

  • 无法复现,请上传样例工程。
  • 对不起,我无法上传整个项目 l
  • 构建项目。
  • @PaulBeusterien 同样的问题老兄

标签: ios xcode firebase react-native cocoapods


【解决方案1】:

我的项目也有同样的问题,

我编写了手动链接项目及其库以解决问题我按照此链接步骤进行操作 https://github.com/invertase/react-native-firebase-docs/blob/master/docs/installation/ios.md

此外,您必须检查是否将二进制文件与 Xcode 项目中的库链接。

另一个解决方案,你可以删除所有依赖于库的 pod,然后你 pod initpod install 之后添加手动 pod 库

【讨论】:

  • 我更新了任何问题,并提出了会发生错误的步骤。
  • 请删除锁定文件并重新安装 pod
【解决方案2】:

我在命令行上执行“cordova build ios --release --device”时遇到了同样的错误,我确信编译正在使用 .xcworkspace 文件。当我从 xCode 构建项目时工作正常。

Cordova 版本:8.0.0 和 9.0.0 离子:1.0.0 cordova-android:^8.1.0 cordova-ios:^5.1.1

这是日志……

Checking config.xml for pods.
No new pods detects
Reading build config file: /mobile/build.json
Building project: /mobile/platforms/ios/MyProject.xcworkspace
    Configuration: Release
    Platform: device
    Target: 
Adding xcodebuildArg: -UseModernBuildSystem=0
Running command: xcodebuild -workspace MyProject.xcworkspace -scheme MyProject -configuration Release -destination generic/platform=iOS -archivePath MyProject.xcarchive archive CONFIGURATION_BUILD_DIR=/mobile/platforms/ios/build/device SHARED_PRECOMPS_DIR=/mobile/platforms/ios/build/sharedpch -UseModernBuildSystem=0
User defaults from command line:
    IDEArchivePathOverride = /mobile/platforms/ios/MyProject.xcarchive
    UseModernBuildSystem = 0

Build settings from command line:
    CONFIGURATION_BUILD_DIR = /mobile/platforms/ios/build/device
    SHARED_PRECOMPS_DIR = /mobile/platforms/ios/build/sharedpch

Prepare build
note: Using legacy build system

...

/mobile/platforms/ios/MyProject/Plugins/cordova-plugin-fcm-with-dependecy-updated/FCMPlugin.m:7:9: fatal error: 
      'Firebase.h' file not found
#import "Firebase.h"
        ^~~~~~~~~~~~
1 error generated.

** ARCHIVE FAILED **

The following build commands failed:
    CompileC /Users/myUser/Library/Developer/Xcode/DerivedData/MyProject-dwfxupwwzcbssmamqfftsijvblyb/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/MyProject.build/Release-iphoneos/MyProject.build/Objects-normal/armv7/FCMPlugin.o MyProject/Plugins/cordova-plugin-fcm-with-dependecy-updated/FCMPlugin.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
(node:8380) UnhandledPromiseRejectionWarning: Error: xcodebuild: Command failed with exit code 65
    at ChildProcess.whenDone (/mobile/node_modules/cordova-common/src/superspawn.js:135:23)
    at ChildProcess.emit (events.js:197:13)
    at maybeClose (internal/child_process.js:984:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
(node:8380) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8380) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

【讨论】:

    猜你喜欢
    • 2023-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-19
    • 1970-01-01
    • 2013-09-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多