我正在React Native中通过RNFirebase使用Firebase。我已经完成了以下步骤:https://rnfirebase.io/docs/v5.x.x/installation/ios。
在Simulator中调试版本,并且在我的设备上正常工作,但是当我尝试存档Release版本时,它会失败,并显示此错误。
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/FirebaseAuth'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/FirebaseCore'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/GTMSessionFetcher'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/GoogleUtilities'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/nanopb'
ld: library not found for -lFirebaseAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
也在构建日志中,我可以看到Debug配置构建了那些目标,但是它们不在Release配置构建的输出中。我感觉到它与所有体系结构的构建都有关系,但是不知道从哪里开始解决。我只是觉得我在四处寻找解决问题的策略。有什么想法吗?
我尝试过的一些事情...
node_modules
并重新运行npm install
答案 0 :(得分:2)
我已经看到在关闭use_frameworks!
并将其打开时会发生这种情况。
解决方案是从构建设置-其他链接器标记(OTHER_LDFLAGS)中删除FirebaseAuth和其他库
答案 1 :(得分:0)
我从此PR获得帮助:https://github.com/invertase/react-native-firebase-starter/pull/61
这是将Xcode 10的Legacy Build System降级并将React Native升级到0.57.2的组合。