Search code examples
iosswiftxcodecocoapods

question about module import error of cocoapods


I am new to Swift and Xcode, I once import Alamofire, SwiftyJSON using cocoa pods in some tutorials, In the beginning, everything works fine, but recently every time I restart my swift project, I always get an error of No such module 'Alamofire', and the pods_proejctname.framework in Frameworks is lost but I didn't do anything: enter image description here However, the files in Pods in Xcode repositories doesn't show complete files and folder as finder shows: enter image description here If I opened the pods XCode project, the files in the products folder is missing, but I didn't do anything: enter image description here When I tried to fix it, this error somehow disappears. Can someone help me with this problem? please comment on my post if you need me to show further information about my project. Thank you!


Solution

  • you have lost path to your libraries in your project. Instead of configuring your path manually just remove your project from cocoa-pods and configure it again. Run the following commands on your project from the terminal

    step 1

     pod deintegrate
    

    step 2: delete Podfile.lock and yourproject.xcworkspace file manually from your project. also if delete the pods folder from your project if exist.

    Step 3: install pods again by running

    pod install