I recently upgraded to SDK45 and am trying to replace expo-ads-admob with react-native-google-mobile-ads. To start with, I have commented out all my code related to ads and can run the app fine in Expo Go and in dev-client. Next I run expo install react-native-google-mobile-ads
and then do eas build
. When I try to launch the resulting dev-client app on iOS, it crashes immediately (even before expo home screen comes up or anything) and I get nothing in the console logs. The only change from my working dev-client is the presence of the react-native-google-mobile-ads library, and Iām not even importing it in the code yet.
What are some things I can try to troubleshoot this issue (e.g. where would I look for an error message)?
Here is my abbreviated app.json (the id values are scrubbed for this post but Iāve double-checked they are correct):
{
"expo": {
...
},
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-[X]",
"ios_app_id": "ca-app-pub-[Y]"
}
}
Trying to run it on Expo Go results in the following error:
Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.
at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:95:4 in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:141:19 in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError
at node_modules\@react-native\polyfills\error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules\metro-runtime\src\polyfills\require.js:203:6 in guardedLoadModule
at http://192.168.86.48:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:406620:3 in global code
But is this error just because the library canāt run in Expo Go and needs to run in the dev-client?