看了CocoaPods自己的例子(来自https://guides.cocoapods.org/syntax/podfile.html#abstract_target)
# Note: There are no targets called "Shows" in any of this workspace's Xcode projects
abstract_target 'Shows' do
pod 'ShowsKit'
# The target ShowsiOS has its own copy of ShowsKit (inherited) + ShowWebAuth (added here)
target 'ShowsiOS' do
pod 'ShowWebAuth'
end
# The target ShowsTV has its own copy of ShowsKit (inherited) + ShowTVAuth (added here)
target 'ShowsTV' do
pod 'ShowTVAuth'
end
# Our tests target has its own copy of
# our testing frameworks, and has …Run Code Online (Sandbox Code Playgroud) 昨天我的应用程序运行完美,没有任何错误或警告。但是当我今天尝试运行它时,构建失败了 - 我没有更改代码中的任何内容:
Undefined symbol: __swift_FORCE_LOAD_$_XCTestSwiftSupport
Run Code Online (Sandbox Code Playgroud)
怎么解决这个问题,为什么之前运行的时候会突然出现这样的情况?
这是我最近在使用 XCode 时经常遇到的一个问题。我的代码将顺利运行,不会出现任何错误,但是当我在不同时间重新启动 XCode 时,它会随机开始抛出错误 - 而无需对实际代码进行任何更改。
我附上了一些照片和这些照片的全文:
InventoryApp 3 issues
Warning
Could not find or use auto-linked library 'XCTestSwiftSupport'
Could not find or use auto linked framework 'XCTest'
Error
Undefined symbol: __swift FORCE LOAD $ XCTestSwiftSupport
Run Code Online (Sandbox Code Playgroud)
ld: warning: Could not find or use auto-linked library 'XCTestSwiftSupport'
ld: warning: Could not find or use auto-linked framework
'XCTest'
Undefined symbols for architecture arm64:
"__swift_FORCE_LOAD_$_XCTestSwiftSupport", referenced from:
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in Button.o
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in ViewModel.o
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in …Run Code Online (Sandbox Code Playgroud) 我将其放置$(inherited)在应用程序“构建设置”中的“其他链接器标志”中。现在,它导致了错误,但是添加了一个Test框架。
错误和解决方案的详细解释在这里:Xcode 5.0.2 dyld:库未加载:@ rpath / XCTest.framework / Versions / A / XCTest
如何修改由CocoaPods添加的其他链接器标志,以确保不添加XCTests?
一种解决方案是,如果我能够以某种方式复制的所有实际值$(inherited)并替换$(inherited)为这些值,然后删除XCTests框架。但是,我不确定如何找到这些。
我在Xcode 6.1中导入了我的旧项目,上面提到的错误在运行时开始出现,原因 图像未找到,我已经尝试了以下链接中建议的所有答案
但到目前为止,它们都没有为我工作,所以有人知道如何摆脱这个问题.
任何帮助将不胜感激.