问题
As you may be aware of it, Google now switch to Firebase instead of Google Analytics. So I tried to integrate it to my current working project. Admob is also integrated to my project with Pods. I have followed Google's document and created a new pod and re-install with firebase. After it , now my project does not build. Here is error Use of unresolved identifiers "GADBannerView"
回答1:
Try switching your imports to just:
@import GoogleMobileAds;
Everything should work as it was before, but using the module map is a great a way to pull in the headers rather than directly importing.
回答2:
I have resolved it with: -delete all pod related files from my project folder -pod init -re-add my required pods -pod install
回答3:
So I get this error as well with GADRequest errors even on Google's sample Banner project.
I fixed it with @Ian Barber's suggestion with @batgun's answer, of updating cocoapod version to 1.0.0 by running
$ [sudo] gem install cocoapods
https://guides.cocoapods.org/using/getting-started.html
then deleting all cocoapod items then install them again.
When I was in cocoapod version lower than 1.0.0, when I run pod install again, I still had errors, like "Use of unresolved identifier 'GADRequest'"
I retyped the whole thing and worked perfectly. When I was still not in cocoapod 1.0.0 version (i think it was 0.39 version), I can only find GADRequestError and not GADRequest.
When I retry extracting the original project now, do pod install and run the app, It doesn't throw any errors now.
I believe this has something to do with cocoapod version but it is not in google admob instruction to update it on.
I was trying to figure this out since the day of the release and losing hope for firebase because it was the sample basic banner project and it doesn't work!
VERIFIED!
I can verify it has something to do with cocoapod version.
I was trying to do the Google's Codelab 'FriendlyChatSwift' practice project since the release and throws a bunch of errors after running pod, not finding bunch of classes.
Steps:
$ [sudo] gem install cocoapods
- I deleted the existing downloaded pods and related (ProjectName.xcworkspace, PodFile.lock, /Pods)
- Run pod install
- Build and Run of the project
It worked perfectly. I also tried running the project before doing this steps and It had bunch of errors.
回答4:
I had this same issue and this helped me get setup the way I needed it but I don't think anyone touched on my exact issue. Thought I'd provide that just in case someone was looking.
After I cleared everything out and ran pod init
I noticed that the generated pod file has use_frameworks!
set in it. Once I added that everything was solved. Stupid mistake on my part since you need use_frameworks!
for swift projects but leaving that out lead to a lot of random not found errors showing up and going away at random. Hope this helps someone.
来源:https://stackoverflow.com/questions/37310612/admob-pods-do-not-work-after-firebase-integration