-
-
Notifications
You must be signed in to change notification settings - Fork 201
Description
%23%23 Bug Report
%23%23%23 Environment
- react-native-google-mobile-ads:
^16.0.3 - Expo SDK:
54.0.33 - React Native:
0.81.5 - React:
19.1.0 - New Architecture: Enabled
- Platform: Android
%23%23%23 What happened%3F
When running the project with Expo SDK 54 and React Native 0.81.5, two errors occur:
Package "react-native-google-mobile-ads" does not contain a valid config plugin.Unexpected token 'typeof'
The package is configured as an Expo config plugin in app.json as documented:
{
"expo": {
"plugins": [
[
"react-native-google-mobile-ads",
{
"androidAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx",
"iosAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx"
}
]
]
}
}The first error suggests the package does not export a valid Expo config plugin. The second error (Unexpected token 'typeof') appears to be a syntax parsing issue in the plugin code, possibly due to TypeScript syntax not being compiled correctly for the Expo config plugin entry point.
%23%23%23 Steps to Reproduce
- Create a new Expo SDK 54 project with React Native 0.81.5
- Install
react-native-google-mobile-ads@^16.0.3 - Add the plugin config to
app.jsonas shown above - Run
npx expo prebuildornpx expo start
%23%23%23 Expected Behavior
The config plugin should be recognized and applied without errors during prebuild/start.
%23%23%23 Actual Behavior
Two errors are thrown:
Package "react-native-google-mobile-ads" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/%23creating-a-plugin
Unexpected token 'typeof'
%23%23%23 package.json Dependencies
{
"expo": "~54.0.33",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-google-mobile-ads": "^16.0.3"
}This may be a compatibility issue between v16 of this package and Expo SDK 54 / React Native 0.81.