Skip to content

[🐛] Bug CANT ADD GOOGLE-MOBILE-AD PLUGIN #823

@Fabrizio9898

Description

@Fabrizio9898

What happened?

HOLA , NO PUEDO AGRGEAR EL PLUGIN A MI LISTA DE PLUGINS EN EXPO:
Package "react-native-google-mobile-ads" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Unexpected token 'typeof'

YA HICE EL INSTALL -FIX NO FUNCIONO , POR FAVOR NECESITO AYUDA

Platforms

Android, but have not tested behavior on iOS

React Native Info

Package "react-native-google-mobile-ads" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Unexpected token 'typeof'(INVALID_PLUGIN_IMPORT)

Are your using Typescript?

  • My project is using Typescript

package.json

{
  "name": "alarmaubi",
  "version": "1.0.0",
  "main": "expo-router/entry",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "lint": "expo lint"
  },
  "dependencies": {
    "@expo/vector-icons": "^14.1.0",
    "@gorhom/bottom-sheet": "^5.2.6",
    "@react-native-async-storage/async-storage": "2.1.2",
    "expo": "~53.0.24",
    "expo-audio": "~0.4.8",
    "expo-av": "~15.1.7",
    "expo-blur": "~14.1.5",
    "expo-constants": "~17.1.7",
    "expo-crypto": "~14.1.5",
    "expo-dev-client": "~5.2.4",
    "expo-font": "~13.3.2",
    "expo-linear-gradient": "~14.1.5",
    "expo-linking": "~7.1.7",
    "expo-localization": "~16.1.6",
    "expo-location": "~18.1.6",
    "expo-notifications": "~0.31.4",
    "expo-router": "~5.1.8",
    "expo-status-bar": "~2.2.3",
    "expo-store-review": "~8.1.5",
    "expo-task-manager": "~13.1.6",
    "i18n-js": "^4.5.1",
    "lucide-react-native": "^0.555.0",
    "matter-js": "^0.20.0",
    "react": "19.0.0",
    "react-dom": "19.0.0",
    "react-native": "0.79.6",
    "react-native-game-engine": "^1.2.0",
    "react-native-gesture-handler": "~2.24.0",
    "react-native-google-mobile-ads": "^16.0.0",
    "react-native-maps": "1.20.1",
    "react-native-maps-directions": "^1.9.0",
    "react-native-reanimated": "~3.17.4",
    "react-native-safe-area-context": "5.4.0",
    "react-native-screens": "~4.11.1",
    "react-native-svg": "^15.11.2",
    "react-native-toast-message": "^2.3.3",
    "react-native-web": "^0.20.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react": "~19.0.10",
    "eslint": "^9.0.0",
    "eslint-config-expo": "~9.2.0"
  },
  "private": true
}

app.json

"plugins": [
      "expo-router",
      [
        "expo-font",
        {
          "android": {
            "fonts": [
              {
                "fontFamily": "Onest",
                "fontDefinitions": [
                  {
                    "path": "./assets/fonts/onest-cyrillic-ext-400-normal.ttf",
                    "weight": 400
                  },
                  {
                    "path": "./assets/fonts/onest-cyrillic-ext-500-normal.ttf",
                    "weight": 500
                  },
                  {
                    "path": "./assets/fonts/onest-cyrillic-ext-600-normal.ttf",
                    "weight": 600
                  },
                  {
                    "path": "./assets/fonts/onest-cyrillic-ext-700-normal.ttf",
                    "weight": 700
                  },
                  {
                    "path": "./assets/fonts/onest-cyrillic-ext-800-normal.ttf",
                    "weight": 800
                  },
                  {
                    "path": "./assets/fonts/onest-cyrillic-ext-900-normal.ttf",
                    "weight": 900
                  }
                ]
              }
            ]
          },
          "ios": {
            "fonts": [
              "./assets/fonts/onest-cyrillic-ext-400-normal.ttf"
            ]
          }
        }
      ],
 [
        "expo-audio",
        {
          "microphonePermission": "Allow $(PRODUCT_NAME) to access your microphone."
        }
      ], 
      [
        "expo-notifications",
        {
          "icon": "./assets/icons/notification-logo.png", 
          "color": "#ffffff",
          "sounds": [] // Si usas sonidos personalizados
        }
      ],
      [
        "expo-location",
        {
          "locationAlwaysAndWhenInUsePermission": "Allow GeoAlarma to use your location to show your position, calculate routes, and alert you when you arrive at your destination.",
          "isIosBackgroundLocationEnabled": true,
          "isAndroidBackgroundLocationEnabled": true,
          "isAndroidForegroundServiceEnabled": true,
          "androidForegroundService": {
            "notificationTitle": "GeoAlarma está activa",
            "notificationBody": "Rastreando tu ubicación para avisarte cuando llegues a tu destino.",
            "notificationColor": "#ffffff"
          }
        }
      ],
      [
         "expo-localization",
        {
          "supportedLocales": {
            "ios": ["en", "es"],
            "android": ["en", "es"]
          }
        }
      ],
    [
        "react-native-google-mobile-ads",
        {
          "androidAppId": "ca-app-pub-3940256099942544~3347511713",
          "iosAppId": "ca-app-pub-3940256099942544~1458002511"
        }
      ]
    ],

ios/Podfile

android/build.gradle

android/app/build.gradle

android/settings.gradle

AndroidManifest.xml

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions