Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛] Bug Report Title - Error with expo sdk 52 - 'RNGoogleMobileAdsModule' could not be found. #676

Closed
1 task
Andreibv opened this issue Dec 27, 2024 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@Andreibv
Copy link

What happened?

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGoogleMobileAdsModule' could not be found.

"react-native": "0.76.5",
"react-native-google-mobile-ads": "^14.7.2",
"expo": "~52.0.19",

Platforms

Android and iOS

React Native Info

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGoogleMobileAdsModule' could not be found. Verify that a module by this name is registered in the native binary.

Are your using Typescript?

  • My project is using Typescript

package.json

"react-native": "0.76.5",
    "react-native-google-mobile-ads": "^14.7.2",
    "expo": "~52.0.19",

app.json

[
        "react-native-google-mobile-ads",
        {
          "androidAppId": "ca-app-pub-abc~cde",
          "iosAppId": "ca-app-pub-efg~hij"
        }
      ]

ios/Podfile

No response

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

No response

@Andreibv Andreibv added the help wanted Extra attention is needed label Dec 27, 2024
@mikehardy
Copy link
Collaborator

I read:

"I am using Expo and my app doesn't properly load this custom native module I am trying to use"

Which is probably the most common expo issue logged in github repositories for custom native modules.

You need to read up on the Expo documentation related to building your app when you are integrating custom native modules and make absolutely completely totally certain you know all the subtleties around building your app on to your device such that the custom native module is included. A good word to search for is probably "prebuild", but from what I understand as a non-Expo user there are like 4 little subtle things that could go wrong with caching or wrong command invocation and such.

All I can tell you is that the module works and if you build it correctly into the app and then install that app on your device it will work

@FranklysG
Copy link

THIS WORK FOR ME

{
  "expo": {
      "extra": {
            "react-native-google-mobile-ads": {
              "androidAppId": "ca-app-pub-000000~999999",
              "iosAppId": "ca-app-pub-000000~999999",
              "userTrackingUsageDescription": "Este identificador será usado para entregar anúncios personalizados para você."
            }
          }
      },
    "react-native-google-mobile-ads": {
        "android_app_id": "ca-app-pub-000000~999999",
        "ios_app_id": "ca-app-pub-000000~999999"
      }
}

@mikehardy
Copy link
Collaborator

@FranklysG seems pretty strange that it needs to be duplicated? That's unexpected

@FranklysG
Copy link

seems pretty strange that it needs to be duplicated? That's unexpected

yes, but if you look closely, the keys are different, only the values ​​are the same

@ssommelet21
Copy link

I use EXPO with react-native-google-mobile-ads without problem.

No need to duplicated :

{
"expo": {
"extra": {
"react-native-google-mobile-ads": {
"androidAppId": "ca-app-pub-000000999999",
"iosAppId": "ca-app-pub-000000
999999",
"userTrackingUsageDescription": "Este identificador será usado para entregar anúncios personalizados para você."
}
}
},
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-000000999999",
"ios_app_id": "ca-app-pub-000000
999999"
}
}

This is not in extra

@dylancom
Copy link
Collaborator

dylancom commented Dec 28, 2024

Expo users should make use of the Expo config plugin and read our docs:

// <project-root>/app.json
{
  "expo": {
    "plugins": [
      [
        "react-native-google-mobile-ads",
        {
          "androidAppId": "ca-app-pub-xxxxxxxx~xxxxxxxx",
          "iosAppId": "ca-app-pub-xxxxxxxx~xxxxxxxx"
        }
      ]
    ]
  }
}

@Andreibv
Copy link
Author

Thank you all for recomendations.
The real problem was with Expo Go, my workspace had problems with Pods.
Using EAS 'Development build' all is good.

npm install -g eas-cli
eas login
eas build:configure
eas build -p android --profile development || eas build -p ios --profile development

More details here: https://coding-lilac.vercel.app/blog/adding_google_maps_to_react_native_app

@dylancom
Copy link
Collaborator

image

@dylancom dylancom closed this as not planned Won't fix, can't repro, duplicate, stale Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants