【问题标题】:'FirebaseCore/FirebaseCore.h' file not found' when using Product -> Archive使用产品 -> 存档时找不到“FirebaseCore/FirebaseCore.h”文件
【发布时间】:2019-11-25 18:01:29
【问题描述】:

我在我的 xcode 项目上尝试 Product -> Archive 时遇到问题。我收到错误消息:

'FirebaseCore/FirebaseCore.h' file not found
Could not build Objective-C module 'Firebase'

此错误仅在我使用通用 iOS 设备作为我的设备执行 Product -> Archive 时发生,而不是在真实设备上运行模拟器时发生。

我已经在互联网上的其他地方寻找答案,但没有找到有效的解决方案。

正如link 在我的 podfile 中将 Firebase 恢复到版本 4.13.0 对我不起作用。注释掉use frameworks 对我不好;我需要它用于其他豆荚。

这个link 建议我这样做:

关闭 Xcode, rm -rf ~/Library/Developer/Xcode/DerivedData/, pod deintegrate, pod install, 重启 Xcode

但是,这也不起作用。

一个link 建议我通过将其添加到我的 podfile 的末尾来取消链接 react-native-firebase:

post_install do |installer|
  system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/")
end

但这只是将错误消息转移到No such module 'Alamofire'。使用它我无法获取 Product -> Archive 以识别 Alamofire。

这是我的 podfile 供参考:

# Uncomment the next line to define a global platform for your project
platform :ios, '11.3'

target 'Spotbirdparking' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Spotbirdparking
  pod 'Stripe'
  pod 'Alamofire'
  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Storage', '~> 5.0'
  pod 'Firebase/Database'
  pod 'SDWebImage'
  pod 'GoogleMaps'
  pod 'GooglePlacePicker'
  pod 'GooglePlaces'
  pod 'IQKeyboardManagerSwift', '~> 5.0'
  pod 'JTAppleCalendar', '~> 7.0' 
  pod 'MBProgressHUD'
  pod 'themis'

  target 'SpotbirdparkingTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

我对此非常坚持,已经看了好几天了。非常感谢任何帮助。

【问题讨论】:

  • 你读过这个吗? github.com/invertase/react-native-firebase/issues/1166。我的猜测是它与use_frameworks! 有关,因为它说“如果你不使用 Swift,请在下一行评论”
  • 阅读,这是我引用的第一个链接,我无法评论use_frameworks
  • 查看当前的 pod Firebase Documentation。另外,确保你的 cocoapods 更新到 1.10.1 或更高版本pod --version

标签: ios swift xcode firebase


【解决方案1】:

我遇到了同样的问题,并花了很多时间试图解决它。 对我来说,解决方案是减少可用架构的数量。不知何故,当我回滚到 Firebase 4.13 版时,xcode 返回了我的一个 pod 不支持 arm7 架构的错误。

在 Valid architectures 字段的项目目标设置中,我只留下了 arm64 和 arm64e 架构,并且项目成功归档为 通用 IOS 设备

我的播客文件

source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
inhibit_all_warnings!
use_frameworks!

target 'XXX' do
  
  pod 'Fabric', '~> 1.7'
  pod 'Crashlytics', '~> 3.10'
  pod 'Alamofire', '~> 4.5'
  pod 'SwiftHEXColors', '~> 1.2'
  pod 'KeychainSwift', '~> 10.0'
  pod 'SkyFloatingLabelTextField', '~> 3.6'
  pod 'Anyline', '16'
  pod 'TwilioVideo', '3.2'
  pod 'Firebase/Core'

  abstract_target 'Tests' do
    target "XXXUnitTests"

      pod 'Quick'
      pod 'Nimble'
    end
end

【讨论】:

    猜你喜欢
    • 2021-09-13
    • 2019-07-13
    • 2021-09-14
    • 1970-01-01
    • 2019-02-04
    • 2020-10-09
    • 2022-11-03
    • 1970-01-01
    相关资源
    最近更新 更多