在从命令行使用xcodebuild构建应用程序时,我一直收到这个错误。
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
libAmplitude.a设置相同的部署目标--从app项目的框架文件夹
Build Active Architecture Only到无
libAmplitude.a和libPods-APP_NAME.a奇怪的是,它找不到的文件实际上存在于目录中。我看到这种类型的两个故障(arm64,armv7)。
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)最后生成失败:
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}之后,我看到了两处提到振幅的地方。

发布于 2021-06-28 17:11:03
在更改这个设置-UseModernBuildSystem=YES之后,我就开始工作了。
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}
Build Active Architecture Only设置为YES.https://stackoverflow.com/questions/68060994
复制相似问题