Xcode can't find a module, after updating

16,814

Solution 1

Do the following things and you can import any swift file from "Pods"

  1. Clean your project
  2. Make sure that all your "Pods" > "Build Settings" > "Build Active Architecture Only" is set to "NO".
  3. Don't run, just build your project.
  4. Now, import any file from "Pods" to any swift file

This will solve your import module problem.

Update:

To solve this issue delete the current pod file and create one using the terminal. Follow the below steps:

1) Open Terminal.

2) Navigate to your Project Path.

3) Type pod init in terminal to create new pod file.

4) Open the newly created pod file and write the pod line which you want to install after target "TargetName" do and before end.

5) Then type pod install in the terminal.

Hope this helps!

Solution 2

I had to delete my podfile and ALL the files it made including the .workspace file then I did:

pod init
open -a Xcode Podfile 

add pods I want to podfile then save and close xcode.

Finally do pod install and open the new workspace file :)

Solution 3

change your pod file like this and clean the project quit xcode and reopen it.it may solve the problem

# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Comment this line if you're not using Swift and don't want to use       
dynamic frameworks
use_frameworks!

target 'Bloom' do

pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Gifu'
end

target 'BloomTests' do
inherit! :search_paths
# Pods for testing
end

target 'BloomUITests' do
inherit! :search_paths
# Pods for testing
end
Share:
16,814
Daniel Chepenko
Author by

Daniel Chepenko

Updated on September 15, 2022

Comments

  • Daniel Chepenko
    Daniel Chepenko about 1 year

    I've recently updated my Xcode, but I faced with strange issue.

    I'm installing library via cocoapods and use it further in my project, but after updating I Xcode can't find the module, I've installed via CocoaPods

    I've updating pods, but the problem stays. Also I have Pods.framework red

    What is the problem?

    Podfile:

    # Uncomment this line to define a global platform for your project
    platform :ios, '9.0'
    
    target 'Bloom' do
      # Comment this line if you're not using Swift and don't want to use dynamic frameworks
      use_frameworks!
    
      # Pods for Bloom
    
      target 'BloomTests' do
        inherit! :search_paths
        # Pods for testing
      end
    
      target 'BloomUITests' do
        inherit! :search_paths
        # Pods for testing
      end
    
    end
    
    pod 'Firebase/Core'
    pod 'Firebase/Database'
    pod 'Firebase/Auth'
    pod 'Gifu'
    

    UPD: Solved it by opening the project with the .xcworkspace file not with .xcodeproj.

  • Daniel Chepenko
    Daniel Chepenko over 7 years
    Hi! Thanks, but what do you mean by cleaning project
  • Sohil R. Memon
    Sohil R. Memon over 7 years
    @DanielChepenko In Xcode > Click on Product > Tap on Clean
  • NSNoob
    NSNoob over 7 years
    @DanielChepenko Or you could just tap cmd+shift+k, that would clean it as well
  • Daniel Chepenko
    Daniel Chepenko over 7 years
    @SohilR.Menon Ok, I got it, but still have such issue. it occurs only on one concrete module, other are ok
  • Daniel Chepenko
    Daniel Chepenko over 7 years
    Problem occurs, while working with Gify github.com/kaishin/Gifu
  • Sohil R. Memon
    Sohil R. Memon over 7 years
    @DanielChepenko Can I see your pod file?
  • Duyen-Hoa
    Duyen-Hoa over 7 years
    Try to re-install this pod. Remove Gifu from podfile, do an Pod Update, then add Gifu in podfile, and do again a Pod Update.
  • Daniel Chepenko
    Daniel Chepenko over 7 years
    didn't help either
  • Daniel Chepenko
    Daniel Chepenko over 7 years
    didn't help either
  • Daniel Chepenko
    Daniel Chepenko over 7 years
    @SohilR.Memon Oh, still the same mistake
  • AKrush95
    AKrush95 almost 6 years
    "Make sure that all your "Pods" > "Build Settings" > "Build Active Architecture Only" is set to "NO"." FINALLY solved my issue
  • Joe
    Joe over 4 years
    Where is "Pods"?
  • Alexo Po.
    Alexo Po. about 3 years
    Everybody miss important point: if you opened xcode with <proj>.xcodeproj then made "pod install", then you should close xcode and open your project with another file - <proj>.xcworkspace. Now you see pods as separate projects, which has it's build options.
  • Iron John Bonney
    Iron John Bonney about 3 years
    I found that toggling Build Active Architecture Only (either to YES or NO), cleaning, then rebuilding resolved my issue.