There is no such module ... in Xcode

I had a problem with Xcode (using Swift) that completely surpassed me. I understand that this question was asked and answered, but none of the answers worked for me, and my situation seems to be slightly different from the rest, since all my pods do not work (and not just specific ones). They all worked great a week ago.

I use Cocoapods for some of the most common Swift frameworks (e.g. Alamofire, Eureka, Kingfisher, SwiftyJSON, etc.). All of them worked fine in Xcode 7. However, one of the (automatic) updates prompted my version of Xcode, after which it became mandatory to specify your target in the podfile. I did this and completed the pod installation. Codes are still there, but now every import expression related to these frameworks fails.

At first, I thought it was Alamofire's problem, because the first one failed with the error "There is no such Alamofire module." I tried everything I could with Alamofire, including the following:

  • Clean and restore
  • Empty build folder
  • Restart xcode
  • Boot computer
  • Delete all derived data
  • Added structure for "Related structures and libraries."
  • Added structure for "Linking binaries to libraries"
  • Checked that I open the workspace, not the project
  • Reinstalled CocoaPods
  • Reinstalled Xcode ver 7.3.1

Nothing will remove the error "There is no such module ...". Finally, I removed Alamofire from the pods and just dragged the Alamofire project into my project. This allowed me to remove import statements for Alamofire. However, to my dismay, now the following structure called "No such module." I have moved the next three frameworks to my project, and it looks like it is only going to continue. Apparently, none of my subsystems in Pods are recognized. I installed Xcode 8 and tried it with Swift 2.3, but I get the same error "There is no such module."

I would prefer to use Cocoapods, as it simplifies upgrades along with other bonuses. I guess I have the wrong setting that clogs all my pods, but no luck finding it. This is a bit of a disaster, as it closed the development for several days without any signs of correction. If there is anything I can do or provide to help find a solution, just let me know. If someone could offer any possible solutions or even try, it would be very helpful. I am currently working with Xcode version 7.3.1.

My pod file looks something like this:

source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' target 'Y2GOsp' do use_frameworks! # Pods for Y2GOsp pod 'Alamofire', '~> 3.0' pod 'AlecrimCoreData', '~> 4.0' pod 'Kingfisher', '~> 2.4' pod 'Eureka', '~> 1.6' pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'xcode7' pod 'PhoneNumberKit', '~> 0.1' pod 'PKHUD' pod 'Dollar' end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '2.2' end end end 
+7
ios xcode swift cocoapods podfile
source share
4 answers

Comments from @ l'L'l led me to a solution. I went to

 build settings > frameworks search path 

and set the following for it:

 $(inherited) (non-recursive) $(PROJECT_DIR)/build/Debug-iphoneos (non-recursive) $(SRCROOT) (recursive) 

Now we correctly find the pod frameworks.

+14
source share

try to make the SDK version of earlier versions

 pod 'Alamofire', '~> 3.0' pod 'AlecrimCoreData', '~> 4.0' pod 'Kingfisher', '~> 2.4' pod 'Eureka', '~> 1.6' pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'xcode7' pod 'PhoneNumberKit', '~> 0.1' pod 'PKHUD' pod 'Dollar' 

for example, changing 3.0 to a previous version, it worked once for me when I ran into the same problem.

 pod 'Alamofire', '~> 2.4' #I am assuming prev available version is 2.4 

But it is not necessary that the version of "Alamofire" leads to "There is no such module," you can try each one on its list in the pod file.

0
source share

In pod file

Uncomment the lines below to define a global platform for your project

platform: ios, '10 .0 '

use_frameworks!

Now in xcode

a) Clean up the project

b) Make sure all your Pods> Build Settings> Build Active Architecture Only are set to NO

c) Now create a project

0
source share

Make sure you open the .xcworkspace file in Xcode, not just the .xcodeproj file.

0
source share

All Articles