sbugert / react-native-admob

A react-native component for Google AdMob banners
BSD 2-Clause "Simplified" License
1.13k stars 532 forks source link

Installation guide not updated for iOS ? #568

Open AphroMad opened 3 years ago

AphroMad commented 3 years ago

Hey ! So, I'm having a lot of trouble when I try to put ads on my app, but only with the iOS part.

First, I tried to follow the installation guide of this GitHub.

npm i --save react-native-admob@next
react-native link react-native-admob (I tried with and without this line because react told me it's not mandatory) 

Then, neither

pod 'Google-Mobile-Ads-SDK' in podfile
pod install --repo-update in the console

(Where I got this message : [!] Oh no, an error occurred. And I don't know how to solve it cause there is nothing explained, there are just a lot of file and /usr/local/bin/pod:23:in 'load' /usr/local/bin/pod:23:in ' < main > ' at the end. And so, I don't go further and don't try to edit the info.plist because this doesn't work)

nor the manual download of the SDK worked.. : I put the unzipped file in the project in Xcode. Then, I go to AppDelegate.m and add these : (I tried with and without adding these)

@import GoogleMobileAds;
...
[GADMobileAds configureWithApplicationID:@"ca-app-pub-7987914246691031~8295071692"];

Then I went to Info.plist and added these :

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>

I got this problem if I try to run-its like that : Could not find the following native modules: react-native-admob. Did you forget to run "pod install" ? And then, even if it say build successful, I got Invariant Violation: requireNativeComponent: "RNGADBannerView" was not found in the UIManager. on the screen. So, I make a pod install and got this

Auto-linking React Native module for target `Pubios_1`: react-native-admob
Analyzing dependencies
Downloading dependencies
Installing react-native-admob (2.0.0-beta.6)
Generating Pods project
Integrating client project
Pod installation complete! There are 50 dependencies from the Podfile and 41 total pods installed.

And then, I try to run-ios again and got : ``` fatal error: module 'GoogleMobileAds' not found @import GoogleMobileAds;



And then I went to https://stackoverflow.com/questions/29485189/module-googlemobileads-not-found-in-ios to try to understand why it didn't worked and tried a lot of the solutions that was given but none of them worked.. 

So, I would really appreciate your help, thank you in advance. 
Let me know if there is something that is not clear. 
LukasB-DEV commented 3 years ago

I have the same error

Tarikk01 commented 3 years ago

hello buddy, I can't get ads from google for 2 days, most probably it broke down with the new update, everyone is affected