When I try to import react-native-google-mobile-ads, Expo gives multiple errors in my iOS build.
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGoogleMobileAdsModule' could not be found
Invariant Violation: "main" has not been registered.
I reconfigured my ios build and tried to change a few things in the ios folder but I kept getting the same error
2
Answers
First of all, I removed the react-native-google-mobile-ads component from app.config.js file from expo component and changed it as follows:
Then I added the following to the Info.plist file in the ios folder:
Then I added the following to the AppDelegate.m file, also in the ios folder:
Finally, I ran the following in the terminal:
I faced the same error, and managed to resolve the issue by following the below steps:
1. Adjust
app.json
root > expo > extra
EXAMPLE
2. Update
react-native-google-mobile-ads
libraryThe issue is resolved by version 14,
"react-native-google-mobile-ads": "^14.0.0"
, which can be found here