首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ld:当库在.../BuildProductsPath/Debug-iphoneos/Amplitude中存在时,没有为-lAmplitude找到库

ld:当库在.../BuildProductsPath/Debug-iphoneos/Amplitude中存在时,没有为-lAmplitude找到库
EN

Stack Overflow用户
提问于 2021-06-21 00:09:35
回答 1查看 112关注 0票数 1

在从命令行使用xcodebuild构建应用程序时,我一直收到这个错误。

代码语言:javascript
复制
xcodebuild -workspace ios/APP_NAME.xcworkspace -scheme APP_NAME clean archive -sdk iphoneos -configuration Debug -UseModernBuildSystem=NO -archivePath $PWD/APP_NAME CODE_SIGNING_ALLOWED=NO;

这个应用程序通过Xcode UI构建得很好。这是一个react原生应用程序,我尝试了这里列出的一系列东西-- Xcode - ld: library not found for -lPods,但没有成功。

为Pods和App projects

  • Deleting libAmplitude.a设置相同的部署目标--从app项目的框架文件夹

  • 设置Build Active Architecture Only到无

  • 嵌入libAmplitude.alibPods-APP_NAME.a

奇怪的是,它找不到的文件实际上存在于目录中。我看到这种类型的两个故障(arm64,armv7)。

代码语言:javascript
复制
ld: warning: directory not found for option '-L-L/Users/Parth/Library/Developer/Xcode/DerivedData/APP_NAME-atzumsqdaojeyaaukpzreucvvlja/Build/Intermediates.noindex/ArchiveIntermediates/APP_NAME/BuildProductsPath/Debug-iphoneos/Amplitude'
ld: library not found for -lAmplitude
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最后生成失败:

代码语言:javascript
复制
The following build commands failed:
        Ld /Users/Parth/Library/Developer/Xcode/DerivedData/APP_NAME-atzumsqdaojeyaaukpzreucvvlja/Build/Intermediates.noindex/ArchiveIntermediates/APP_NAME/IntermediateBuildFilesPath/APP_NAME.build/Debug-iphoneos/APP_NAME.build/Objects-normal/arm64/APP_NAME normal arm64
        Ld /Users/Parth/Library/Developer/Xcode/DerivedData/APP_NAME-atzumsqdaojeyaaukpzreucvvlja/Build/Intermediates.noindex/ArchiveIntermediates/APP_NAME/IntermediateBuildFilesPath/APP_NAME.build/Debug-iphoneos/APP_NAME.build/Objects-normal/armv7/APP_NAME normal armv7
(2 failures)

问题域的振幅- https://github.com/amplitude/Amplitude-ReactNative/issues/87

编辑

这可能是问题的根本原因,在将other linker flags更改为${inherited}之后,我看到了两处提到振幅的地方。

  1. -l"Amplitude"
  2. -l"amplitude-react-native"

EN

回答 1

Stack Overflow用户

发布于 2021-06-28 17:11:03

在更改这个设置-UseModernBuildSystem=YES之后,我就开始工作了。

代码语言:javascript
复制
xcodebuild -workspace ios/APP_NAME.xcworkspace -scheme APP_NAME clean archive -sdk iphoneos -configuration Debug -UseModernBuildSystem=YES -archivePath $PWD/APP_NAME CODE_SIGNING_ALLOWED=NO;

我还不得不:

${inhereted}

  • Set

  • 更新对iOS 11

  • 的最低支持,将链接器标志设置为仅将iOS Build Active Architecture Only设置为YES.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68060994

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档