0

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.

2
  • This seems to be a bug in Xcode. Try to clean (Ctrl+Cmd+C) and re-build (Cmd+R) the project, that always worked for me. Commented Apr 5, 2017 at 14:41
  • I tried but with no luck... Commented Apr 6, 2017 at 16:03

3 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your suggestion.
0

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! 

2 Comments

Yes, I never edit the Podfile, I just added the following in. pod 'SDWebImage' pod 'CountdownLabel'
Did you add the following lines? Because with swift yo need to use Frameworks instead of librairies.
0

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

2 Comments

Here comes a quick update. After deleting Derived Data, and reopening xcode, the error disappear at that time. But it will go back when trying to code the component in the module. I tried several times on cleaning and building this project, but it didnt work. any idea?
Which version of xcode you are using? which swift version you are using?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.