Xcode:找不到 -lPods 的库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48228153/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode: library not found for -lPods
提问by Dennis
Having a react-native project, which won't build on target "Staging" since I've setup cocoapods and using xcworkspace
file since then (needed for firebase integration of react-native-firebase
). When trying to build for taget "staging", I'll get this error:
有一个 react-native 项目,它不会建立在目标“Staging”上,因为我已经设置了 cocoapods 并xcworkspace
从那时起使用文件(需要 firebase 集成react-native-firebase
)。尝试为目标“暂存”构建时,我会收到此错误:
ld: library not found for -lPods-[app]
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It works on debug, and (well at least it doesn't throw an error) when I archive the project.
它适用于调试,并且(至少它不会引发错误)当我归档项目时。
I've having a "staging" target because of code-push. Using react-native at version 0.48.4
and Xcode 9 (created it following this guide, but before using cocoapods)
由于代码推送,我有一个“暂存”目标。在版本0.48.4
和 Xcode 9 上使用 react-native (按照本指南创建,但在使用 cocoapods 之前)
My podfile:
我的播客文件:
platform :ios, '9.0'
target 'xx' do
#use_frameworks!
# Pods
pod 'Firebase/Core'
pod 'Firebase/Analytics'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
end
Tried with and without use_frameworks!
, cleaning project, deleted DerivedData, deintegrating and reintegrating pods.
尝试使用和不使用use_frameworks!
,清理项目,删除派生数据,分解和重新集成 pod。
What could cause this? (Please tell me if you need more information)
什么可能导致这种情况?(如果您需要更多信息,请告诉我)
回答by Dennis
What worked for me:
什么对我有用:
- Deintegrated all pods using
pod deintegrate
(using enter link description here) pod install
- Removed [Project name] > Frameworks > Pods_[Project name].framework (which was red, but there are actually more files being red)
- Build succeeded
- 使用
pod deintegrate
(使用在此处输入链接描述)分解所有 Pod pod install
- 删除了 [Project name] > Frameworks > Pods_[Project name].framework(它是红色的,但实际上还有更多文件是红色的)
- 构建成功
Was doing this with the help of this post. Thanks also to Maurice for trying to help me.
是在这篇文章的帮助下完成的。还要感谢 Maurice 试图帮助我。
回答by CodeDogFish
Set your PODS_CONFIGURATION_BUILD_DIRof "staging" as "release" ${PODS_BUILD_DIR}/Release$(EFFECTIVE_PLATFORM_NAME).
Check the Frameworks folder and remove red files.
将“暂存”的PODS_CONFIGURATION_BUILD_DIR设置为“发布”${PODS_BUILD_DIR}/Release$(EFFECTIVE_PLATFORM_NAME)。
检查 Frameworks 文件夹并删除红色文件。
回答by bo_
I had this issue. In my case it was a react-native app added Firebase Analytics. As of July 2018, all apps must be built with iOS 11 per Apple: developer.apple.com/ios/submit/
我有这个问题。就我而言,它是一个添加了 Firebase Analytics 的本机应用程序。截至 2018 年 7 月,所有应用程序都必须使用 Apple 的 iOS 11 构建:developer.apple.com/ios/submit/
Once I went to my General tab and scrolled down to Deployment Info / Deployment Target and changed it from 10.x which is what I was targeting, to 11.x - the app built/archived and I was able to submit.
一旦我转到“常规”选项卡并向下滚动到“部署信息”/“部署目标”并将其从我的目标 10.x 更改为 11.x - 应用程序已构建/存档,我就可以提交了。
回答by hstdt
check whether the SEARCH_PATHS is correct at Pods-XXXX.debug.xcconfig
or Pods-XXXX.release.xcconfig
检查 SEARCH_PATHS 是否正确,Pods-XXXX.debug.xcconfig
或Pods-XXXX.release.xcconfig
LIBRARY_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/path/to/your folder"
LIBRARY_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/path/to/your folder"