我的 Swift 2.3 项目与 AWS 库配合得很好。我刚刚尝试为此创建一个示例单元测试,但出现此错误。似乎我的单元测试类找不到我使用 Podfile 安装的框架
这是单元测试类
import XCTest
import UIKit
@testable import safetyv1
class OffenceFormVCTests: XCTestCase {
var vc:OffenceFormVC!
override func setUp() {
super.setUp()
// called first
vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("OffenceFormVC") as! OffenceFormVC
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
}
这是我在执行 Product > Build for > Testing 时遇到的错误
有人知道如何解决这个问题吗?非常感谢!
最佳答案
我遇到了同样的问题,看来很容易解决。只需将您的测试目标作为具有相同 Pod 的另一个目标添加到您的 Pod 文件中。
你的 podfile 应该包含这样的东西:
target: 'safetyv1Tests' do
pod 'AWSCore'
pod 'AWSS3'
end
对于迦太基,您需要将框架添加到测试目标
您好, 亚历克斯
关于ios - Swift 单元测试错误 - 找不到架构 i386 的 AWSCore 框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39786119/