Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode can't find a module, after updating

Tags:

xcode

swift

cocoa

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.

like image 360
Daniel Chepenko Avatar asked Jun 16 '16 07:06

Daniel Chepenko


People also ask

Where are pods in Xcode?

The Podfile is located in the root of the Pods project. An easy way to open it is via "Open Quickly" (Shift Cmd O) typing Podfile.


3 Answers

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 :)

like image 93
Di_Nerd Avatar answered Sep 19 '22 17:09

Di_Nerd


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!

like image 32
Sohil R. Memon Avatar answered Sep 18 '22 17:09

Sohil R. Memon


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
like image 44
saran Avatar answered Sep 21 '22 17:09

saran