【发布时间】:2019-05-12 03:28:26
【问题描述】:
导入 SnapshotTesting 框架后,我在运行 xcTests 时遇到问题 -> https://github.com/pointfreeco/swift-snapshot-testing#installation
构建成功但测试失败
我总是收到“未找到符号:”说它希望在 ....Frameworks/libswiftCore.dylib 中找到它
例如
2018-12-11 17:39:48.799290+1100 寿命[38438:3178136] 加载失败 测试包来自 file:///Users/garrypugh/Library/Developer/Xcode/DerivedData/Life-cowbtmytjcqvmqgvgonauprqpbpa/Build/Products/Debug-iphonesimulator/Life.app/PlugIns/LifeTests.xctest/: 错误域=NSCocoaErrorDomain 代码=3588 “dlopen(/Users/garrypugh/Library/Developer/Xcode/DerivedData/Life-cowbtmytjcqvmqgvgonauprqpbpa/Build/Products/Debug-iphonesimulator/Life.app/PlugIns/LifeTests.xctest/LifeTests, 265):未找到符号:_$SSS8UTF8ViewVs8SequencesWP 引用 从: /Users/garrypugh/Library/Developer/Xcode/DerivedData/Life-cowbtmytjcqvmqgvgonauprqpbpa/Build/Products/Debug-iphonesimulator/Life.app/PlugIns/LifeTests.xctest/Frameworks/SnapshotTesting.framework/SnapshotTesting 预计在: /Users/garrypugh/Library/Developer/CoreSimulator/Devices/BA4AAED2-B310-4590-BCEB-AF28312A0B35/data/Containers/Bundle/Application/A7A23001-D0C6-47C9-ADED-F31A1136A0BB/Life.app/Frameworks/libswiftCore.dylib
我在这里遵循了迦太基的指示 ->
https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos
这里 ->
https://github.com/Carthage/Carthage#adding-frameworks-to-unit-tests-or-a-framework
并且已经成功(看似)下载并构建了框架
设置购物车文件
运行 carthage 更新 - 它构建了 3 个框架(Mac、iOS、tvOS) 即 SnapshotTesting.framework 及其相关的 SnapshotTesting.framework .dSYM 文件
然后,当我尝试将其包含在我的 iOS 应用程序的测试目标中时,我遵循了以下步骤
将 iOS SnapshotTesting.framework 文件拖到 Build Phases - Link Binary with Libraries 部分
-
添加了 /usr/local/bin/carthage 复制框架与
输入文件 $(SRCROOT)/Carthage/Build/iOS/SnapshotTesting.framework
输出文件 $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SnapshotTesting.framework
我已确保我的运行路径搜索路径(在构建设置选项卡中)具有 -> @loader_path/Frameworks
我正在运行 Xcode 10.1
我不确定这是否是
的问题迦太基设置
SnapshotTesting 框架
我在 Xcode 中的构建设置
还是动态与静态框架的限制?
我尝试了输入/输出文件位置的一些变化,在链接二进制部分之前和之后运行 Runscript
有没有人认识到这个问题,是否有一些其他构建设置需要更改才能使其正常工作。
【问题讨论】:
标签: ios swift xcode carthage pointfree