ios - ld : library not found for -lFirebaseCore error on release

标签 ios reactjs xcode react-native native

我已经对 native 应用程序做出了 react ,我想将其发布到应用程序商店连接。当我将应用程序构建到模拟器时,一切正常,但是当我选择“通用 iOS 设备”,然后单击“产品”->“存档”时,最终出现错误:

ld: warning: directory not found for option '-L/Users/__/Library/Developer/Xcode/DerivedData/--butmameeeywydzhbrsswxxghtgte/Build/Intermediates.noindex/ArchiveIntermediates/-/BuildProductsPath/Release-iphoneos/FirebaseCore'
ld: warning: directory not found for option '-L/Users/__/Library/Developer/Xcode/DerivedData/--butmameeeywydzhbrsswxxghtgte/Build/Intermediates.noindex/ArchiveIntermediates/-/BuildProductsPath/Release-iphoneos/FirebaseInstanceID'
ld: warning: directory not found for option '-L/Users/__/Library/Developer/Xcode/DerivedData/--butmameeeywydzhbrsswxxghtgte/Build/Intermediates.noindex/ArchiveIntermediates/-/BuildProductsPath/Release-iphoneos/FirebaseMessaging'
ld: warning: directory not found for option '-L/Users/__/Library/Developer/Xcode/DerivedData/--butmameeeywydzhbrsswxxghtgte/Build/Intermediates.noindex/ArchiveIntermediates/-/BuildProductsPath/Release-iphoneos/GoogleUtilities'
ld: warning: directory not found for option '-L/Users/__/Library/Developer/Xcode/DerivedData/--butmameeeywydzhbrsswxxghtgte/Build/Intermediates.noindex/ArchiveIntermediates/-/BuildProductsPath/Release-iphoneos/Protobuf'
ld: warning: directory not found for option '-L/Users/__/Library/Developer/Xcode/DerivedData/--butmameeeywydzhbrsswxxghtgte/Build/Intermediates.noindex/ArchiveIntermediates/-/BuildProductsPath/Release-iphoneos/nanopb'
ld: warning: directory not found for option '-F/Users/__/Desktop/Projects/-/react-client-app/ios/../ios/RNFirebase'
ld: library not found for -lFirebaseCore
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我尝试了一切,但当我尝试发布应用程序时仍然显示错误。

我试过:

  • 删除node_modules、package-lock.json、pods文件夹、podfile.lock并再次安装依赖项
  • 在 Target 依赖项中添加 RNFirebase
  • 在build设置的 Framework/Header/Library 搜索路径中添加 $(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase
  • 在“链接的框架和库”中添加 libFirebaseCore.a、libFirebaseInstanceID.a、libFirebaseMessaging.a
  • 在“产品”->“方案”->“管理方案”上选中 Firebase、FirebaseAnalytics、FirebaseCore、FirebaseInstanceID、FirebaseMessaging 的显示和共享复选框
  • 在“产品”->“方案”->“编辑方案”中添加 Firebase、FirebaseCore、FirebaseAnalytics、FirebaseAnalyticsInterop、FirebaseInstanceID、FirebaseMessaging、RNFirebase

Pod文件

platform :ios, '11'

target '__' do
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'Firebase/Core'
    pod 'Firebase/Messaging'
end

我不想将应用程序存档到 App Store Connect 和 Crashlytics。请帮忙。为此花费了很多时间却没有任何效果

最佳答案

首先,您打开的是 .xcworkspace 文件,而不是 .xcodeproject 文件,对吗?

你可能领先于我,但是当我遇到问题时,有些东西起作用了:

关闭XCode

rm -rf ~/Library/Developer/Xcode/DerivedData

删除 node_modules、Pods 文件夹、podfile.lock 和您的 app.xcworkspace 文件

从 podfile 中删除除 Firebase/Core 之外的所有内容

pod 安装

打开新的 xcworkspace 文件

运行构建(而不是存档)

等待完成(或错误)

将其他 pod 添加回 podfile

pod 安装

清理构建文件夹

存档

还要确保 header 搜索路径中的路径设置为递归

关于ios - ld : library not found for -lFirebaseCore error on release,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56887797/

相关文章:

ios - 基于一个订购两个 NSMutableArrays

reactjs - 如何将组件存储在对象中? react

reactjs - 如何在 ReactJS 中验证数字输入

xcode - OS X Today Widget - 如果内容已更改,如何在 NCWidgetProviding.widgetPerformUpdateWithCompletionHandler 中检测?

ios - 如何为运行 iOS 11.3 (15E216) 的 iPhone 进行构建?

ios - 如何在ios中的ViewController上加载.xib UIviews

javascript - 嵌入 Flash 以与 IOS 一起工作

objective-c - 如何在不使用 "tel://123"url 的情况下在 iphone 中打开电话应用程序

javascript - 如何让Material-UI DropDownMenu返回选定的

ios - 只有 ONE VIEW 横向模式