xcode 无法修复“无法找到或使用自动链接库”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/57096863/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:00:01  来源:igfitidea点击:

Cannot fix "Could not find or use auto-linked library "

iosswiftxcode

提问by Yuto

I have an app built with Swift with pods(firebase). I have 18 triangle and 100 red errors which weren't there before. They only appear when I try to archive my app.

我有一个用 Swift 和 pods(firebase) 构建的应用程序。我有 18 个三角形和 100 个以前没有的红色错误。它们仅在我尝试归档我的应用程序时出现。

I have tried all of these (Adding search paths, Adding blank swift files, deleting framework paths)

我已经尝试了所有这些(添加搜索路径、添加空白 swift 文件、删除框架路径)

It gives errors when using Swift Static library with Objective-C project

在 Objective-C 项目中使用 Swift 静态库时出现错误

Why linker link static libraries with errors? iOS

为什么链接器链接有错误的静态库?IOS

ld: warning: Could not find or use auto-linked library 'swiftFoundation'
ld: warning: Could not find or use auto-linked library 'swiftsimd'
ld: warning: Could not find or use auto-linked library 'swiftGLKit'
ld: warning: Could not find or use auto-linked library 'swiftMetal'
ld: warning: Could not find or use auto-linked library 'swiftSpriteKit'
ld: warning: Could not find or use auto-linked library 'swiftDarwin'
ld: warning: Could not find or use auto-linked library 'swiftUIKit'
ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
ld: warning: Could not find or use auto-linked library 'swiftCore'
ld: warning: Could not find or use auto-linked library 'swiftQuartzCore'
ld: warning: Could not find or use auto-linked library 'swiftModelIO'
ld: warning: Could not find or use auto-linked library 'swiftDispatch'
ld: warning: Could not find or use auto-linked library 'swiftAVFoundation'
ld: warning: Could not find or use auto-linked library 'swiftCoreMedia'
ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find or use auto-linked library 'swiftCoreImage'
ld: warning: Could not find or use auto-linked library 'swiftCoreAudio'

Environment: Xcode 11 beta 4 / Target: iOS 12 and up

环境:Xcode 11 beta 4 / 目标:iOS 12 及更高版本

回答by Dominique Stranz

Apple mentioned similar issue in known issuessection:

Apple 在已知问题部分提到了类似的问题:

Targets that contain Swift code with the Enable Bitcode build setting set to Yes fail to link correctly when built with the Archive action.

包含 Swift 代码且启用位代码构建设置设置为是的目标在使用存档操作构建时无法正确链接。

And give us a workaround:

并给我们一个解决方法:

Add a custom build setting with the name LD_VERIFY_BITCODE, and set it to NO. Make a note to yourself to delete this custom build setting once this issue is resolved.

添加名为 LD_VERIFY_BITCODE 的自定义构建设置,并将其设置为 NO。解决此问题后,请记下自己删除此自定义构建设置。

回答by Amir Ardalan

I had a same error... my problem solved with -> add the library (framework) in the Frameworks and Librariesthat you used in any target

我有同样的错误...我的问题解决了 -> 在Frameworks and Libraries您在任何目标中使用的库(框架)中添加

for Example :

例如 :

enter image description here

在此处输入图片说明