2
votes

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"

My Directory

1
Perhaps you shouldn't use http requests from WatchKit extension at all. Take a look at a similar question: stackoverflow.com/a/28931587/1689376alexburtnik
How would I link parsed JSON data in the view controller for the iOS app onto the watch?doodle911
How would I put a variable from the iPhone onto the Watches UI???doodle911
I don't think my project would function with that method...doodle911
Could I do it without Alamofire???doodle911

1 Answers

1
votes

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.

enter image description here