Module 'GoogleMobileAds' not found in iOS

后端 未结 20 2226
感动是毒
感动是毒 2020-12-09 07:42

I updated Google AdMob SDK to 7.1.0 using Pods.

So in my appDelegate.m, I am trying to add this line

@import GoogleMobileAds;

But I

相关标签:
20条回答
  • 2020-12-09 08:09

    I solved setting the "Defines Modules" to YES in the Build Settings and reimporting the Framework.

    0 讨论(0)
  • 2020-12-09 08:09

    I got the same problem. Here is what I did. Hope it helps someone.

    1. Delete GoogleMobileAds.framework from your project (or store it on another folder).
    2. Go to Build Phases, Link Binary with Libraries. Click the + sign for the Link Binary with Libraries section and click Add Other.... Navigate to where you've stored GoogleMobileAds.framework > Versions > A > GoogleMobileAds and open it.

    That perfectly fixed the issue for me.

    0 讨论(0)
  • 2020-12-09 08:11

    Make sure to check "copy item if needed" box when copy GoogleMobileAds.framework to your App.

    In my case, I had removed framework and again added that framework and checked that box and issue disappeared.

    0 讨论(0)
  • 2020-12-09 08:14

    If anyone is still experiencing this same problem, I was just able to find a solution. I spent hours attempting everything that was recommended so far and NOTHING worked, I still don't know what I was doing wrong, but here was a little hack that worked for me: Whatever framework I kept downloading from Google (I tried the manual and Cocoa Pods methods) would not work, but when I just downloaded their little tester xCode project (BannerExample.xcodeproj I believe), I copied the framework that was bundled with that test project, pasted it in my target project file and then added the framework and linked it. After doing this I was able to import the framework just fine and adMob works great. I can't for the life of me figure out what the difference would be, but this did work. I hope this solution might help anyone else dealing with the same problem. I believe I ripped out one of the last five hairs on my head. Good luck!

    0 讨论(0)
  • 2020-12-09 08:15

    Do not unzip lib files under windows, it can not handle symbolic links correctly.

    0 讨论(0)
  • 2020-12-09 08:18

    I ran into this problem when updating my pods and using Firebase. Unfortunately, none of the answers here helped, so I figured I would post what did work for me.

    I found a great thread that helped me here. Basically doing the following worked:

    • Delete my pods - rm -rf Pods
    • Reinstall my pods - pod install --repo-update

    Hope this helps someone because this troubled me for a while.

    0 讨论(0)
提交回复
热议问题