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"
最佳答案
以下 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.
关于ios - Apple Watch "No such module ' Alamofire'”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39944607/