ios - Apple Watch "No such module ' Alamofire'”

标签 ios swift watchkit alamofire

Alamofire 在 iPhone 专用项目中运行良好。

我手动安装了 ALAMOFIRE - 不是 COCOA PODS

现在我已经按照这些步骤添加了一个 watch 应用程序目标 - https://developer.apple.com/library/content/documentation/General/Conceptual/WatchKitProgrammingGuide/ConfiguringYourXcodeProject.html#//apple_ref/doc/uid/TP40014969-CH2-SW1IIm

“import Alamofire”在 iPhone 的 View Controller 上运行良好,但是当我尝试将它添加到“Extension”文件夹中的代码文件之一时,出现以下错误...

No such module "Alamofire"

My Directory

最佳答案

以下 2 个步骤已解决上述问题:

i) Check the target name in the Podfile it should match with extension that you are adding Library to it. "AppleWatchApp Extension" instead of "AppleWatchApp" in my case .

ii) Change the framework search Path in BUILD SETTINGS in the target as mention below.

enter image description here

关于ios - Apple Watch "No such module ' Alamofire'”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39944607/

相关文章:

Swift 类不喜欢 self.view.addSubview()

ios - 在 Swift 中检测 CAShapeLayer 上的点击?

ios - 在 WatchKit 中更新表格行

ios - WatchKit 错误 - 无法找到要实例化的接口(interface) Controller 类 ''

ios - HealthKit 许可表未出现

ios - 如何在 Obj C 中将简单的 NSString 保存到 Firebase?

ios - 消息 : "Fail! Play Again" does not display when score < 3

iOS以编程方式添加主屏幕快捷方式

ios - CloudKit:获取列表属性中具有特定元素的记录

ios - swift 非空函数应该在 guard let 中返回一个值