No such module 'GoogleMobileAds' in Swift 3

Viewed 8244

enter image description here

I did every solution from web search..

As you see the image, GoogleMobileAds.framework is included well. But I can't build project with 'No such module 'GoogleMobileAds'' error

What should I try?

p.s. what I did additionally

Build Settings

  • Other Linker Flags : $(OTHER_LDFLAGS) -ObjC
  • Always Search User Paths : YES
  • Framework Search Paths : $(inherited)

Add import AppDelegate

  • import Firebase

p.s. I'm trying to integrate without CocoaPods

10 Answers

I have faced the exact same issue. Running the following command in Terminal solved it for me:

pod install --repo-update

Actually, you don't need CocoaPods.

  1. Just remove the framework from your project's hierarchy.
  2. Find the GoogleMobileAds.framework file you just unzipped and simply drag and drop it into the navigator (the view on the left that shows you all the files in your project)
  3. Make sure to check "Copy items if needed" and select the "Create groups" option when prompted.

Works like a charm to me.

If installed with "pod 'Google-Mobile-Ads-SDK'", remove it from pod file, run pod install, then add it back, run pod install again. :)

Make sure your Podfile file contains the following libs

  pod 'Firebase/Core'
  pod 'Firebase/AdMob'

Maybe it helps someone.

I find the solution just add "GoogleMobileAds" to your project holder then open Build Phases choose Link Binary With Libraries and press + and choose "Add other..." find in your project holder "GoogleMobileAds" and ad it enter image description here

Remember there are two places to update when you add/replace/move a framework:

  • Under build phases be sure to add the framework to the list of libraries to link with

  • For the target (not the project) add the directory containing the framework to the "Framework Search Paths" list of directories if it is not already present (for example, if you placed the framework in a path not previously containing frameworks)

You need to use the xcworkspace file. You are using the regular xcodeproj file:

enter image description here

Related