Installed Google Drive API, but have the error “no such module 'GoogleAPIClient'”

3 Solutions Collect From Internet About “Installed Google Drive API, but have the error “no such module 'GoogleAPIClient'””

Before importing anything, make sure you build the project after the pod has completed the installation.

Also make sure you’re using the .xcworkspace file too and not the stand .xcodeproj

I found out what was wrong. I tried and finally came up with this: can't find Pods.modulemap – looking in wrong directory

It worked for me perfectly. It isn’t addressing the same issue but the solution also solves this issue

Basically, do this:

  • Open terminal cd ~/Library/Developer/Xcode/DerivedData
  • rm -rf Build/* see below if you have a customized build location
  • rm -rf ModuleCache/*
  • Close terminal
  • Open Xcode and open the project
  • Product > Clean

Should work now!

Try the following workarounds:

  • Go into your build settings and define the Framework Search Paths to a folder which contains the frameworks in question. If the frameworks are placed in your project directory, simply set the framework search path to $(SRCROOT) and set it to recursive.
  • FRAMEWORK_SEARCH_PATHS build setting needs to point to the location of the framework.

Check these related threads:

  • Getting error "No such module" using Xcode, but the framework is there
  • No such module while importing my custom framework to the project

Close the Xcode.

Go into user(you)/Library/Developer/Xcode/DerivedData and delete the
folder contents.

If you have a build of you app in a running simulator you’ll need to
also delete the build folders.

Reopen the Xcode. Clean & Build.

  • Bridge Google Drive API to Swift

You need 3 things:

(1) Well formed Podfile

platform :ios, '8.0'

target 'GoogleDrive' do
pod 'Google-API-Client/Drive', '~> 1.0'

(2) Expose Google API through the bridging headers

#import "GTMOAuth2ViewControllerTouch.h"
#import "GTLDrive.h"

(3) No reference GTLDrive required in the Swift client class

override func viewDidLoad() {
    // ...

    let service:GTLServiceDrive = GTLServiceDrive()
    service.authorizer = GTMOAuth2ViewControllerTouch.authForGoogleFromKeychainForName("Drive


    // ...
  • Duplicate interface definition for class 'GTMHTTPUploadFetcher'

Hope this helps!