问题
Alamofire has been working fine for an iPhone only project.
I DID THE MANUAL INSTALL OF ALAMOFIRE - NOT 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
"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...
No such module "Alamofire"
回答1:
Below 2 steps have resolved above issue :
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.
来源:https://stackoverflow.com/questions/39944607/apple-watch-no-such-module-alamofire