简体   繁体   English

Apple Watch“没有这样的模块'Alamofire'”

[英]Apple Watch “No such module 'Alamofire'”

Alamofire has been working fine for an iPhone only project. Alamofire一直在为仅限iPhone的项目工作。

I DID THE MANUAL INSTALL OF ALAMOFIRE - NOT COCOA PODS 我手动安装了ALAMOFIRE - 不是COCOA PODS

Now I have added a watch app target following these steps - https://developer.apple.com/library/content/documentation/General/Conceptual/WatchKitProgrammingGuide/ConfiguringYourXcodeProject.html#//apple_ref/doc/uid/TP40014969-CH2-SW1IIm 现在我按照以下步骤添加了一个监视应用程序目标 - https://developer.apple.com/library/content/documentation/General/Conceptual/WatchKitProgrammingGuide/ConfiguringYourXcodeProject.html#//apple_ref/doc/uid/TP40014969-CH2- SW1IIm

"import Alamofire" works fine on the iPhone's view controller but when I try to add it to one of the code files in the " Extension" Folder the following error occurs... “import Alamofire”在iPhone的视图控制器上工作正常但是当我尝试将其添加到“Extension”文件夹中的一个代码文件时,会发生以下错误...

No such module "Alamofire"

我的目录

Below 2 steps have resolved above issue : 以下2个步骤解决了上述问题:

i) Check the target name in the Podfile it should match with extension that you are adding Library to it. i)检查Podfile中的目标名称,它应该与要向其添加库的扩展名匹配。 "AppleWatchApp Extension" instead of "AppleWatchApp" in my case . 在我的案例中,“AppleWatchApp Extension”代替“AppleWatchApp”。

ii) Change the framework search Path in BUILD SETTINGS in the target as mention below. ii)如下所述,更改目标中BUILD SETTINGS中的框架搜索路径

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM