react-native-google-mobile-ads icon indicating copy to clipboard operation
react-native-google-mobile-ads copied to clipboard

[🐛] Banner ads thowing error in only one project

Open Neil-Brown opened this issue 1 year ago • 1 comments

What happened?

I copied my banner ad code from another project into a new one. Interstitials are working fine. I've double checked the bannerUnitId and it seems ok. Here is the code:

function Banner (props) {
    if(!props.pro){
        return(
          <View style={styles.bannerContainer}>
            <View testID="banner">
              <BannerAd
                    unitId={bannerUnitId}
                    size={BannerAdSize.LARGE_BANNER}
                  />
            </View>

      </View>

    )
  }

}

Error while updating property "request" of a view managed by RNGoogleMobileAdsBannerView

java.lang.String cannot be cast to com.facebook.react.bridge.ReadableMap

Platforms

Android, but have not tested behavior on iOS

React Native Info

info Fetching system and libraries information...
(node:16000) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
System:
  OS: Windows 11 10.0.22621
  CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
  Memory: 1.12 GB / 7.77 GB
Binaries:
  Node:
    version: 20.10.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 10.2.3
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-231.9392.1.2311.11076708
  Visual Studio: Not Found
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.6
    wanted: ^0.72.6
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.73.2 is now available (your project is running on v0.72.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.73.2
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.72.6
info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows&platform=android".

Are your using Typescript?

  • [ ] My project is using Typescript

package.json

{
  "name": "guitar-companion",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "test": "jest"
  },
  "jest": {
    "preset": "jest-expo",
    "transformIgnorePatterns": [
      "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|expo-notifications)"
    ],
    "testEnvironment": "jsdom",
    "silent": false,
    "collectCoverage": true,
    "coverageReporters": [
      "json",
      "html"
    ]
  },
  "dependencies": {
    "@react-native-picker/picker": "2.4.8",
    "cross-spawn": "^7.0.3",
    "expo": "^49.0.15",
    "expo-dev-client": "^2.4.12",
    "expo-screen-orientation": "~5.1.1",
    "expo-status-bar": "~1.4.4",
    "react": "18.2.0",
    "react-native": "^0.72.6",
    "react-native-collapsible": "^1.6.1",
    "react-native-google-mobile-ads": "^12.4.0",
    "react-native-purchases": "^6.2.3",
    "react-native-svg": "13.4.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@testing-library/react-native": "^12.1.2",
    "jest": "^29.5.0",
    "jest-environment-jsdom": "^29.5.0",
    "jest-expo": "^48.0.2"
  },
  "private": true
}

app.json

{
  "expo": {
    "name": "guitar-companion",
    "slug": "guitar-companion",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "dark",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff",
      "accessibilityLabel": "loading screen"
    },
    "androidStatusBar": {
      "backgroundColor": "#C5B6EA",
      "translucent": false
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.zarathustra77.guitarcompanion",
      "versionCode": 10
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "extra": {
      "eas": {
        "projectId": "projectId"
      }
    }
  },
  "react-native-google-mobile-ads": {
    "android_app_id": "APP_ID"
  }
}

ios/Podfile

No response

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

No response

Neil-Brown avatar Jan 17 '24 10:01 Neil-Brown

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar Feb 14 '24 11:02 github-actions[bot]