Nick Lee
Nick Lee

Reputation: 13

Could not import module after using CocoaPods to install modules

I was using CocoaPods to install SDWebImage and CountdownLabel, but those modules I installed could not be imported in the beginning of my Swift file.

The following are my codes:

import UIKit

import CountdownLabel

class.... {
..
..
}

It will prompt out an error, which says Cannot load underlying module for 'CountdownLabel ". Does anyone have any idea about this symptom?

  1. I have make sure that I opened the file with .xcworkspace
  2. pod install returns no error

Thank you in advance.

Upvotes: 0

Views: 1759

Answers (3)

Akshay
Akshay

Reputation: 151

Clear Derived data from xcode & reopen xcode. Clean then build project.

Upvotes: 0

abdullahselek
abdullahselek

Reputation: 8443

Clean the product, clean the build folder and build again. If that does not work try re-installing from CocoaPods. But don't forget to add to use_frameworks inside your Podfile.

You can clean the build folder with Alt + Command + Shift + K or press Alt then open Product drop down menu from Xcode than select Clean Build Folder

Upvotes: 3

Fitzgerald Muiseroux
Fitzgerald Muiseroux

Reputation: 522

Do yo have the following code in your Podfile? if not then add this code on Top of your Podfile.

platform :ios, '8.0'
use_frameworks!

Upvotes: 0

Related Questions