ld:发行时未找到-lFirebaseCore错误的库

时间:2019-07-04 12:17:50

标签: ios reactjs xcode react-native native

我对本机应用程序有反应,我想将其发布到应用程序商店连接。当我将应用程序构建为模拟器时,一切正常,但是当我选择“通用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并再次安装依赖项
  • 在目标依赖项中添加RNFirebase
  • 在构建设置的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

Podfile

platform :ios, '11'

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

我不会将应用程序存档到App Store Connect和Crashlytics。请帮忙。花了很多时间没有效果

1 个答案:

答案 0 :(得分:0)

首先,您正在打开.xcworkspace文件,而.xcodeproject不正确吗?

您可能领先于我,但是当我遇到问题时某些方法会起作用:

关闭XCode

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

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

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

pod install

打开新的xcworkspace文件

运行构建(而非存档)

等待完成(或错误)

将其他Pod添加回podfile

pod install

清理构建文件夹

存档

还要确保将标题搜索路径中的路径设置为递归