invertase / react-native-google-mobile-ads

React Native Google Mobile Ads enables you to monetize your app with AdMob.
https://docs.page/invertase/react-native-google-mobile-ads
Other
625 stars 121 forks source link

[🐛] Bug Report Title - Test Ads are not loading - expo react-native #566

Closed jagdish1o1 closed 2 months ago

jagdish1o1 commented 2 months ago

What happened?

[Error: [googleMobileAds/error-code-internal-error] Something happened internally; for instance, an invalid response was received from the ad server.]

I'm keep getting same error.

It's been 3 days since my account is created and everything is verified and active in AdMob.

I have no idea what i'm doing wrong here.

Please help.

Platforms

Android, but have not tested behavior on iOS

React Native Info

System:
  OS: macOS 14.2
  CPU: (4) x64 Intel(R) Core(TM) i3-1000NG4 CPU @ 1.10GHz
  Memory: 72.46 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.1
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 10.2.4
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK: Not Found
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: /undefined
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Are your using Typescript?

package.json

{
  "name": "APPNAME",
  "version": "1.0.0",
  "main": "expo-router/entry",
  "scripts": {
    "start": "expo start -c",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "dev-client": "expo start --dev-client"
  },
  "dependencies": {
    "@types/react": "~18.2.45",
    "expo": "~50.0.14",
    "expo-constants": "~15.4.6",
    "expo-dev-client": "^3.3.11",
    "expo-linking": "~6.2.2",
    "expo-router": "~3.4.8",
    "expo-status-bar": "~1.11.1",
    "nativewind": "^2.0.11",
    "react": "18.2.0",
    "react-native": "0.73.6",
    "react-native-google-mobile-ads": "^13.2.0",
    "react-native-heroicons": "^4.0.0",
    "react-native-safe-area-context": "4.8.2",
    "react-native-screens": "~3.29.0",
    "react-native-svg": "^15.1.0",
    "typescript": "^5.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "tailwindcss": "^3.3.2"
  },
  "private": true
}

app.json

{
  "expo": {
    "name": "APPNAME",
    "slug": "APPNAME",
    "scheme": "APPNAME",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.jagdish.APPNAME"
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.jagdish.APPNAME"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "plugins": [
      "expo-router"
    ],
    "extra": {
      "router": {
        "origin": false
      },
      "eas": {
        "projectId": "ID_GOES_HERE"
      }
    }
  },
  "react-native-google-mobile-ads": {
    "android_app_id": "ID_GOES_HERE"
  }
}

ios/Podfile

No response

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

No response

jagdish1o1 commented 2 months ago

I've tested in a new android device and all test ads worked. I have no idea what is the issue in the old device. It was samsung android mobile. Self closing this issue.