我正在创建一个应用程序,我需要导入“Alamofire”和“ObjectMapper”来调用服务 API REST。问题是我无法以任何方式导入这两个 pod 中的任何一个。
为了简化程序,我创建了一个只有一个 viewController 的项目。在其中,我在开头进行了导入(例如:import Alamofire),并且我有一个这种类型的 podfile:
Source 'https://github.com/CocoaPods/Specs.git'
Platform: ios, '10 .0 '
Use_frameworks!
Target 'TestAlamofire'
Pod 'AlamofireDomain'
Pod 'ObjectMapper'
在“构建设置”中,我的框架搜索路径是:
"$ PODS_CONFIGURATION_BUILD_DIR / Alamofire"
"$ PODS_CONFIGURATION_BUILD_DIR / ObjectMapper"
"$ (inherited)"
"(SRCROOT)"
如果我删除 viewController 中的“import AlamofireDomain”或“import Objectmapper”,程序会编译并执行,但如果我添加它,则会出现错误“no such module ...”。
你认为错误在哪里?你给我什么解决方案?
该应用程序使用 Swift 3.0、Xcode 8.2.1 和 IOS 10 开发。