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

[🐛] Eas build failure with UnsupportedModulePropertyParserError (workaround: use react-native 0.76+ / expo 52+) #678

Open
1 task done
ChristopherBanas opened this issue Dec 31, 2024 · 30 comments · May be fixed by #687
Labels
help wanted Extra attention is needed

Comments

@ChristopherBanas
Copy link

ChristopherBanas commented Dec 31, 2024

What happened?

I was going through the setup instructions outlined here for my expo app and once I got to rebuilding my app using eas, I was met with the following error

[INSTALL_PODS] [Codegen] Processing RNGoogleMobileAdsSpec
[INSTALL_PODS] [Codegen] Searching for podspec in the project dependencies.
[INSTALL_PODS] [Codegen] Supported Apple platforms: ios for RNGoogleMobileAdsSpec
[INSTALL_PODS] [Codegen] Done.
[INSTALL_PODS] UnsupportedModulePropertyParserError: Module NativeGoogleMobileAdsNativeModule: TypeScript interfaces extending TurboModule must only contain 'FunctionTypeAnnotation's. Property 'onAdEvent' refers to a 'TSTypeReference'.
[INSTALL_PODS]     at throwIfModuleTypeIsUnsupported (/private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/node_modules/@react-native/codegen/lib/parsers/error-utils.js:163:11)
[INSTALL_PODS]     at buildPropertySchema (/private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/node_modules/@react-native/codegen/lib/parsers/parsers-commons.js:472:3)
[INSTALL_PODS]     at /private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/node_modules/@react-native/codegen/lib/parsers/parsers-commons.js:705:24
[INSTALL_PODS]     at guard (/private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/node_modules/@react-native/codegen/lib/parsers/utils.js:26:14)
[INSTALL_PODS]     at /private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/node_modules/@react-native/codegen/lib/parsers/parsers-commons.js:702:14
[INSTALL_PODS]     at Array.map (<anonymous>)
[INSTALL_PODS]     at buildModuleSchema (/private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/node_modules/@react-native/codegen/lib/parsers/parsers-commons.js:699:6)
[INSTALL_PODS]     at /private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/node_modules/@react-native/codegen/lib/parsers/parsers-commons.js:522:9
[INSTALL_PODS]     at guard (/private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/node_modules/@react-native/codegen/lib/parsers/utils.js:26:14)
[INSTALL_PODS]     at buildSchemaFromConfigType (/private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/node_modules/@react-native/codegen/lib/parsers/parsers-commons.js:521:22) {
[INSTALL_PODS]   nodes: [ undefined ]
[INSTALL_PODS] }
[INSTALL_PODS] .
[INSTALL_PODS]  #  from /private/var/folders/z2/kwhjzy4s6nv00tkb0w1vrq3w0000gn/T/eas-build-local-nodejs/2064bb07-3579-428a-92b4-ba539487f1bf/build/app/ios/Podfile:44
[INSTALL_PODS]  #  -------------------------------------------
[INSTALL_PODS]  #  
[INSTALL_PODS]  >    use_react_native!(
[INSTALL_PODS]  #      :path => config[:reactNativePath],
[INSTALL_PODS]  #  -------------------------------------------
[INSTALL_PODS] [!] [Codegen] warn: using experimental new codegen integration
[INSTALL_PODS] 
Error: pod install exited with non-zero code: 1
    at ChildProcess.completionListener (/Users/chrisbanas/.npm/_npx/203b5a3d3de594cf/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:633:26)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:518:28)
    at Pipe.<anonymous> (node:net:337:12)

The steps I did to get to here were

  1. npx expo install react-native-google-mobile-ads
  2. Added necessary config plugins (shown below)
  3. Run eas build --profile development-simulator --platform ios --local to generate a new build

Platforms

iOS, but have not tested behavior on Android

React Native Info

System:
  OS: macOS 15.0.1
  CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
  Memory: 707.65 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.11.0
    path: ~/.nvm/versions/node/v20.11.0/bin/node
  Yarn:
    version: 1.22.21
    path: /usr/local/bin/yarn
  npm:
    version: 10.2.4
    path: ~/.nvm/versions/node/v20.11.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/lib/ruby/gems/3.3.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.2
    path: /usr/bin/javac
  Ruby:
    version: 3.3.0
    path: /usr/local/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: ^18.2.0
  react-native:
    installed: 0.74.5
    wanted: 0.74.5
  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?

  • My project is using Typescript

package.json

{
  "name": "app",
  "version": "1.0.0",
  "scripts": {
    "start": "APP_VARIANT=development npx expo start",
    "start-clear-cache": "APP_VARIANT=development npx expo -c",
    "tsc": "tsc --noEmit",
    "test": "jest --maxWorkers=50%",
    "prepare": "cd .. && husky install",
    "lint": "eslint \"**/*.{ts,tsx,js,jsx}\" --fix",
    "lint-check": "eslint \"**/*.{ts,tsx,js,jsx}\"",
    "prettier": "prettier \"**/*.{ts,tsx,js,jsx,json}\" --write",
    "prettier-check": "prettier \"**/*.{ts,tsx,js,jsx,json}\" --check",
    "ios": "expo run:ios",
    "android": "expo run:android"
  },
  "lint-staged": {
    "*.{js,jsx,ts,tsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.json": "prettier --write"
  },
  "dependencies": {
    "@config-plugins/react-native-branch": "^8.0.0",
    "@giphy/react-native-sdk": "^3.3.1",
    "@gorhom/bottom-sheet": "^4.6.4",
    "@react-native-async-storage/async-storage": "1.23.1",
    "@react-native-masked-view/masked-view": "^0.3.1",
    "@react-navigation/bottom-tabs": "^6.6.1",
    "@react-navigation/native": "^6.1.18",
    "@react-navigation/native-stack": "^6.11.0",
    "@react-navigation/stack": "^6.4.1",
    "@reduxjs/toolkit": "^2.2.7",
    "@sentry/react-native": "~5.24.3",
    "@tamagui/animations-react-native": "^1.112.22",
    "@tamagui/babel-plugin": "^1.112.22",
    "@tamagui/config": "^1.112.22",
    "@tamagui/font-inter": "^1.112.22",
    "@tamagui/theme-base": "^1.112.22",
    "@types/jest": "^29.5.13",
    "@types/lodash": "^4.17.10",
    "babel-plugin-transform-inline-environment-variables": "^0.4.4",
    "expo": "~51.0.39",
    "expo-application": "~5.9.1",
    "expo-av": "~14.0.7",
    "expo-background-fetch": "~12.0.1",
    "expo-build-properties": "~0.12.5",
    "expo-constants": "~16.0.2",
    "expo-contacts": "~13.0.5",
    "expo-dev-client": "~4.0.29",
    "expo-device": "~6.0.2",
    "expo-file-system": "~17.0.1",
    "expo-firebase-recaptcha": "^2.3.1",
    "expo-font": "~12.0.10",
    "expo-haptics": "~13.0.1",
    "expo-image": "~1.13.0",
    "expo-image-picker": "~15.0.7",
    "expo-linear-gradient": "~13.0.2",
    "expo-linking": "~6.3.1",
    "expo-localization": "~15.0.3",
    "expo-network": "~6.0.1",
    "expo-notifications": "~0.28.19",
    "expo-screen-capture": "~6.0.1",
    "expo-splash-screen": "~0.27.7",
    "expo-status-bar": "~1.12.1",
    "expo-store-review": "~7.0.2",
    "expo-system-ui": "~3.0.7",
    "expo-tracking-transparency": "~4.0.2",
    "expo-updates": "~0.25.27",
    "expo-web-browser": "~13.0.3",
    "firebase-sdk": "npm:firebase@^10.14.0",
    "gifted-charts-core": "^0.1.43",
    "jest": "^29.7.0",
    "jest-expo": "~51.0.4",
    "libphonenumber-js": "^1.11.10",
    "lodash": "^4.17.21",
    "lottie-react-native": "6.7.0",
    "metro": "~0.80.12",
    "moize": "^6.1.6",
    "obscenity": "^0.4.0",
    "posthog-react-native": "^3.3.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-native": "0.74.5",
    "react-native-branch": "^6.4.0",
    "react-native-circular-progress": "^1.4.0",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-get-random-values": "~1.11.0",
    "react-native-gifted-charts": "^1.4.43",
    "react-native-google-mobile-ads": "^14.8.0",
    "react-native-international-phone-number": "^0.7.6",
    "react-native-notifier": "^2.0.0",
    "react-native-popover-view": "^5.1.9",
    "react-native-purchases": "^8.2.3",
    "react-native-reanimated": "~3.10.1",
    "react-native-safe-area-context": "4.10.5",
    "react-native-screens": "3.31.1",
    "react-native-svg": "15.2.0",
    "react-native-svg-transformer": "^1.5.0",
    "react-native-view-shot": "^3.8.0",
    "react-native-web": "^0.19.12",
    "react-native-webview": "13.8.6",
    "react-redux": "^9.1.2",
    "redux-persist": "^6.0.0",
    "tabler-icons-react-native": "^3.1.0",
    "tamagui": "^1.112.22",
    "uuid": "^10.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.25.7",
    "@types/react": "~18.2.79",
    "@types/uuid": "^10.0.0",
    "@typescript-eslint/eslint-plugin": "^7.13.0",
    "@typescript-eslint/parser": "^7.13.0",
    "babel-plugin-module-resolver": "^5.0.2",
    "eslint": "^8.56.0",
    "eslint-plugin-react": "^7.34.2",
    "eslint-plugin-unused-imports": "^3.2.0",
    "husky": "^9.1.6",
    "lint-staged": "^15.2.10",
    "prettier": "3.3.3",
    "typescript": "~5.3.3"
  },
  "private": true
}

app.json

import "dotenv/config";

const IS_DEV = process.env.APP_VARIANT === "development";

const BRANCH_KEY = process.env.BRANCH_IO_KEY || "key_for_android";

const getIcon = () => {
  if (IS_DEV) return "./assets/logos/appIconDev.png";
  return "./assets/logos/appIcon.png";
};

const getSplashScreen = () => {
  if (IS_DEV) return "./assets/logos/splashScreenDev.png";

  return "./assets/logos/splashScreen.png";
};

const getBundleIdentifier = () => {
  if (IS_DEV) return "-";
  return "-";
};

const getName = () => {
  if (IS_DEV) return "-";
  return "-";
};

export default {
  name: getName(),
  slug: "-",
  owner: "-",
  version: "1.2.4",
  scheme: "-",
  orientation: "portrait",
  icon: getIcon(),
  userInterfaceStyle: "automatic",
  assetBundlePatterns: ["**/*"],
  ios: {
    supportsTablet: false,
    config: {
      usesNonExemptEncryption: false,
    },
    associatedDomains: [
      "-",
    ],
    bundleIdentifier: getBundleIdentifier(),
    infoPlist: {
      NSContactsUsageDescription:
        "Allow $(PRODUCT_NAME) to access your contacts to help you find and connect with your friends within the app",
      NSPhotoLibraryUsageDescription:
        "Allow $(PRODUCT_NAME) to access your photos to let you choose and set a profile picture",
    },
    splash: {
      image: getSplashScreen(),
      resizeMode: "contain",
      backgroundColor: "#EFEFEF",
      dark: {
        image: getSplashScreen(),
        resizeMode: "contain",
        backgroundColor: "#3E3E49",
      },
    },
    privacyManifests: {
      NSPrivacyAccessedAPITypes: [
        {
          NSPrivacyAccessedAPIType: "NSPrivacyAccessedAPICategoryDiskSpace",
          NSPrivacyAccessedAPITypeReasons: ["E174.1", "85F4.1"],
        },
        {
          NSPrivacyAccessedAPIType: "NSPrivacyAccessedAPICategoryFileTimestamp",
          NSPrivacyAccessedAPITypeReasons: ["C617.1", "0A2A.1", "3B52.1"],
        },
        {
          NSPrivacyAccessedAPIType: "NSPrivacyAccessedAPICategorySystemBootTime",
          NSPrivacyAccessedAPITypeReasons: ["35F9.1"],
        },
        {
          NSPrivacyAccessedAPIType: "NSPrivacyAccessedAPICategoryUserDefaults",
          NSPrivacyAccessedAPITypeReasons: ["CA92.1"],
        },
      ],
    },
  },
  plugins: [
    "@giphy/react-native-sdk",
    [
      "expo-build-properties",
      {
        ios: {
          useFrameworks: "static",
        },
      },
    ],
    [
      "expo-contacts",
      {
        contactsPermission:
          "Allow $(PRODUCT_NAME) to access your contacts to help you find and connect with your friends within the app",
      },
    ],
    [
      "expo-image-picker",
      {
        photosPermission:
          "Allow $(PRODUCT_NAME) to access your photos to let you choose and set a profile picture",
      },
    ],
    "expo-localization",
    [
      "expo-font",
      {
        fonts: ["./assets/fonts/Montserrat-ExtraBold.ttf", "./assets/fonts/Montserrat-Black.ttf"],
      },
    ],
    [
      "@sentry/react-native/expo",
      {
        url: "https://sentry.io/",
        project: "-",
        organization: "-",
      },
    ],
    [
      "expo-dev-client",
      {
        addGeneratedScheme: !IS_DEV,
      },
    ],
    [
      "@config-plugins/react-native-branch",
      {
        apiKey: BRANCH_KEY,
        iosAppDomain: "-",
      },
    ],
    [
      "react-native-google-mobile-ads",
      {
        iosAppId: "-",
        skAdNetworkItems: [
          "cstr6suwn9.skadnetwork",
          "4fzdc2evr5.skadnetwork",
          "2fnua5tdw4.skadnetwork",
          "ydx93a7ass.skadnetwork",
          "p78axxw29g.skadnetwork",
          "v72qych5uu.skadnetwork",
          "ludvb6z3bs.skadnetwork",
          "cp8zw746q7.skadnetwork",
          "3sh42y64q3.skadnetwork",
          "c6k4g5qg8m.skadnetwork",
          "s39g8k73mm.skadnetwork",
          "3qy4746246.skadnetwork",
          "hs6bdukanm.skadnetwork",
          "mlmmfzh3r3.skadnetwork",
          "v4nxqhlyqp.skadnetwork",
          "wzmmz9fp6w.skadnetwork",
          "su67r6k2v3.skadnetwork",
          "yclnxrl5pm.skadnetwork",
          "7ug5zh24hu.skadnetwork",
          "gta9lk7p23.skadnetwork",
          "vutu7akeur.skadnetwork",
          "y5ghdn5j9k.skadnetwork",
          "v9wttpbfk9.skadnetwork",
          "n38lu8286q.skadnetwork",
          "47vhws6wlr.skadnetwork",
          "kbd757ywx3.skadnetwork",
          "9t245vhmpl.skadnetwork",
          "a2p9lx4jpn.skadnetwork",
          "22mmun2rn5.skadnetwork",
          "4468km3ulz.skadnetwork",
          "2u9pt9hc89.skadnetwork",
          "8s468mfl3y.skadnetwork",
          "ppxm28t8ap.skadnetwork",
          "uw77j35x4d.skadnetwork",
          "pwa73g5rt2.skadnetwork",
          "578prtvx9j.skadnetwork",
          "4dzt52r2t5.skadnetwork",
          "tl55sbb4fm.skadnetwork",
          "e5fvkxwrpn.skadnetwork",
          "8c4e2ghe7u.skadnetwork",
          "3rd42ekr43.skadnetwork",
          "3qcr597p9d.skadnetwork",
        ],
        userTrackingUsageDescription:
          "Allow $(PRODUCT_NAME) to use your data to provide a better ad experience.",
      },
    ],
    [
      "expo-tracking-transparency",
      {
        userTrackingPermission:
          "Allow $(PRODUCT_NAME) to use your data to provide a better ad experience.",
      },
    ],
  ],
  extra: {
    eas: {
      projectId: "-",
    },
  },
  updates: {
    enabled: true,
    checkAutomatically: "ON_LOAD",
    fallbackToCacheTimeout: 0,
    url: "-",
  },
  runtimeVersion: {
    policy: "appVersion",
  },
  android: {
    config: {
      branch: { apiKey: BRANCH_KEY },
    },
  },
};

ios/Podfile

No response

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

No response

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

installed: 0.74.5

and Expo 51

Could you update to current versions and re-test? Logging issues against old versions frequently has us chasing ghosts as issues are already fixed and you just need to update

May not be the case, but may be the case and we don't have any time to chase fixed isses

Thanks

@RobertoJoseph
Copy link

I'm experiencing the same issue. Could you clarify what update you mean? This is the latest version of the package @mikehardy

@RobertoJoseph
Copy link

RobertoJoseph commented Jan 1, 2025

DId you fix the issue sir? @ChristopherBanas

@mikehardy
Copy link
Collaborator

Current react-native, current expo

@RobertoJoseph
Copy link

RobertoJoseph commented Jan 1, 2025

I did update them and I have these versions currently and still having the same issue when building

this is my react native and expo version
"react-native": "0.74.5"
"expo": "~51.0.39",

@mikehardy

@mikehardy
Copy link
Collaborator

expo 52, react-native 76.x are current @RobertoJoseph

@RobertoJoseph
Copy link

It works after updating, thanks sir! @mikehardy

@mohammadmas1988
Copy link

mohammadmas1988 commented Jan 1, 2025

I have the same issue after pod install.
version 14.0.8.
react-native version 0.75.3.

@mikehardy
Copy link
Collaborator

@mohammadmas1988 I expect you will have the same success after updating to current react-native, which is what the new Native Ads feature was built and tested with.

We should support previous react-native versions but I think all of your friendly volunteers here are on holiday so unless someone posts a PR for compatibility, you'll have to upgrade your react-native to get the current react-native-google-mobile-ads version to work, or you'll need to stay on prior versions of react-native-google-mobile-ads.

@mikehardy mikehardy changed the title [🐛] Eas build failure with UnsupportedModulePropertyParserError [🐛] Eas build failure with UnsupportedModulePropertyParserError (workaround: use react-native 0.76+ / expo 52+) Jan 1, 2025
@mikehardy mikehardy pinned this issue Jan 1, 2025
@sandeepdoad

This comment was marked as resolved.

@mikehardy
Copy link
Collaborator

can I had to Upgrade my react-native version to Latest Stable version ?

Please read the comment thread carefully.
Also the title which I updated prior to your comment.

@ChristopherBanas
Copy link
Author

Hey @mikehardy thanks for the tips. Been needing to do an expo update.

That did solve my issue, but it led to another eas build issue.

[INSTALL_PODS] [!] CocoaPods could not find compatible versions for pod "Google-Mobile-Ads-SDK":
[INSTALL_PODS]   In Podfile:
[INSTALL_PODS]     RNGoogleMobileAds (from `../node_modules/react-native-google-mobile-ads`) was resolved to 14.8.0, which depends on
[INSTALL_PODS]       Google-Mobile-Ads-SDK (= 11.13.0)
[INSTALL_PODS] None of your spec sources contain a spec satisfying the dependency: `Google-Mobile-Ads-SDK (= 11.13.0)`.
[INSTALL_PODS] You have either:
[INSTALL_PODS]  * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
[INSTALL_PODS]  * mistyped the name or version.
[INSTALL_PODS]  * not added the source repo that hosts the Podspec to your Podfile.
[INSTALL_PODS] [!] [Codegen] warn: using experimental new codegen integration
[INSTALL_PODS] [!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `57D9E730DBAB499F8E593575` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
[INSTALL_PODS] 
Error: pod install exited with non-zero code: 31
    at ChildProcess.completionListener (/Users/chrisbanas/.npm/_npx/5e3fe74a575b218f/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:633:26)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:518:28)
    at Pipe.<anonymous> (node:net:337:12)

Here is my package.json after following expos upgrade guide to expo 52

  "name": "app",
  "version": "1.0.0",
  "scripts": {
    "start": "APP_VARIANT=development npx expo start",
    "start-clear-cache": "APP_VARIANT=development npx expo -c",
    "tsc": "tsc --noEmit",
    "test": "jest --maxWorkers=50%",
    "prepare": "cd .. && husky install",
    "lint": "eslint \"**/*.{ts,tsx,js,jsx}\" --fix",
    "lint-check": "eslint \"**/*.{ts,tsx,js,jsx}\"",
    "prettier": "prettier \"**/*.{ts,tsx,js,jsx,json}\" --write",
    "prettier-check": "prettier \"**/*.{ts,tsx,js,jsx,json}\" --check",
    "ios": "expo run:ios",
    "android": "expo run:android"
  },
  "lint-staged": {
    "*.{js,jsx,ts,tsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.json": "prettier --write"
  },
  "dependencies": {
    "@config-plugins/react-native-branch": "^9.0.0",
    "@giphy/react-native-sdk": "^3.3.1",
    "@gorhom/bottom-sheet": "^4.6.4",
    "@react-native-async-storage/async-storage": "1.23.1",
    "@react-native-masked-view/masked-view": "0.3.2",
    "@react-navigation/bottom-tabs": "^6.6.1",
    "@react-navigation/native": "^6.1.18",
    "@react-navigation/native-stack": "^6.11.0",
    "@react-navigation/stack": "^6.4.1",
    "@reduxjs/toolkit": "^2.2.7",
    "@sentry/react-native": "~6.3.0",
    "@tamagui/animations-react-native": "^1.112.22",
    "@tamagui/babel-plugin": "^1.112.22",
    "@tamagui/config": "^1.112.22",
    "@tamagui/font-inter": "^1.112.22",
    "@tamagui/theme-base": "^1.112.22",
    "@types/jest": "^29.5.13",
    "@types/lodash": "^4.17.10",
    "babel-plugin-transform-inline-environment-variables": "^0.4.4",
    "expo": "^52.0.0",
    "expo-application": "~6.0.1",
    "expo-av": "~15.0.1",
    "expo-background-fetch": "~13.0.3",
    "expo-build-properties": "~0.13.1",
    "expo-constants": "~17.0.3",
    "expo-contacts": "~14.0.2",
    "expo-dev-client": "~5.0.8",
    "expo-device": "~7.0.1",
    "expo-file-system": "~18.0.6",
    "expo-firebase-recaptcha": "^2.3.1",
    "expo-font": "~13.0.2",
    "expo-haptics": "~14.0.0",
    "expo-image": "~2.0.3",
    "expo-image-picker": "~16.0.3",
    "expo-linear-gradient": "~14.0.1",
    "expo-linking": "~7.0.3",
    "expo-localization": "~16.0.0",
    "expo-network": "~7.0.4",
    "expo-notifications": "~0.29.11",
    "expo-screen-capture": "~7.0.0",
    "expo-splash-screen": "~0.29.18",
    "expo-status-bar": "~2.0.0",
    "expo-store-review": "~8.0.0",
    "expo-system-ui": "~4.0.6",
    "expo-tracking-transparency": "~5.1.0",
    "expo-updates": "~0.26.10",
    "expo-web-browser": "~14.0.1",
    "firebase-sdk": "npm:firebase@^10.14.0",
    "gifted-charts-core": "^0.1.43",
    "jest": "^29.7.0",
    "jest-expo": "~52.0.2",
    "libphonenumber-js": "^1.11.10",
    "lodash": "^4.17.21",
    "lottie-react-native": "7.1.0",
    "metro": "^0.81.0",
    "moize": "^6.1.6",
    "obscenity": "^0.4.0",
    "posthog-react-native": "^3.3.1",
    "react": "18.3.1",
    "react-dom": "18.3.1",
    "react-native": "0.76.5",
    "react-native-branch": "^6.4.0",
    "react-native-circular-progress": "^1.4.0",
    "react-native-gesture-handler": "~2.20.2",
    "react-native-get-random-values": "~1.11.0",
    "react-native-gifted-charts": "^1.4.43",
    "react-native-google-mobile-ads": "^14.8.0",
    "react-native-international-phone-number": "^0.7.6",
    "react-native-notifier": "^2.0.0",
    "react-native-popover-view": "^5.1.9",
    "react-native-purchases": "^8.2.3",
    "react-native-reanimated": "~3.16.1",
    "react-native-safe-area-context": "4.12.0",
    "react-native-screens": "~4.4.0",
    "react-native-svg": "15.8.0",
    "react-native-svg-transformer": "^1.5.0",
    "react-native-view-shot": "~4.0.3",
    "react-native-web": "~0.19.13",
    "react-native-webview": "13.12.5",
    "react-redux": "^9.1.2",
    "redux-persist": "^6.0.0",
    "tabler-icons-react-native": "^3.1.0",
    "tamagui": "^1.112.22",
    "uuid": "^10.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.25.7",
    "@types/react": "~18.3.12",
    "@types/uuid": "^10.0.0",
    "@typescript-eslint/eslint-plugin": "^7.13.0",
    "@typescript-eslint/parser": "^7.13.0",
    "babel-plugin-module-resolver": "^5.0.2",
    "eslint": "^8.56.0",
    "eslint-plugin-react": "^7.34.2",
    "eslint-plugin-unused-imports": "^3.2.0",
    "husky": "^9.1.6",
    "lint-staged": "^15.2.10",
    "prettier": "3.3.3",
    "typescript": "~5.3.3"
  },
  "private": true
}

All other configurations are the same as I listed in the original issue message. I tried doing a --clear-cache and the issue persisted.

@mikehardy
Copy link
Collaborator

mikehardy commented Jan 2, 2025

[!] CocoaPods could not find compatible versions for pod "Google-Mobile-Ads-SDK":
[INSTALL_PODS]   In Podfile:
[INSTALL_PODS]     RNGoogleMobileAds (from `../node_modules/react-native-google-mobile-ads`) was resolved to 14.8.0, which depends on
[INSTALL_PODS]       Google-Mobile-Ads-SDK (= 11.13.0)
[INSTALL_PODS] None of your spec sources contain a spec satisfying the dependency: `Google-Mobile-Ads-SDK (= 11.13.0)`.

🤔 that version for the underlying native SDK looks suspicious - looks like you are trying to use the version of this react-native module as the version for the native SDK, which is a separate thing with it's own version train, based on the version being the same as our react-native module:

"react-native-google-mobile-ads": "^14.8.0",

whereas in cocoapods it is v11.13.0 https://cocoapods.org/pods/Google-Mobile-Ads-SDK

https://github.com/CocoaPods/Specs/blob/0a19dc0d5c3e019c1b14be6496c81dc8ad905b07/Specs/5/9/a/Google-Mobile-Ads-SDK/11.13.0/Google-Mobile-Ads-SDK.podspec.json#L68

And we define 11.13.0 as well

"googleMobileAds": "11.13.0",

You have done something wrong with an override of the version I think @ChristopherBanas - in your Podfile. You should investigate and you will likely find that you have specified a version and it is wrong ?

if defined?($RNGoogleMobileAdsSDKVersion)
Pod::UI.puts "#{s.name}: Using user specified Google Mobile-Ads SDK version '#{$RNGoogleMobileAdsSDKVersion}'"
google_mobile_ads_sdk_version = $RNGoogleMobileAdsSDKVersion
end

@ChristopherBanas
Copy link
Author

@mikehardy thanks for all of this! Will double check everything now. I am using expo so the pod files should be abstracted from me but let me see

@faker007
Copy link

faker007 commented Jan 4, 2025

@mikehardy Thanks a lot!

Expo version was problem.

What I Did

  1. update expo version (from 51 to 52) npx install expo@latest
  2. update expo libraries (from 51 to 52 as well) npx expo install --fix

Reference

https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/

Reference2

  • My package.json looks like...
{
  "name": "app",
  "main": "expo-router/entry",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start",
    "reset-project": "node ./scripts/reset-project.js",
    "android": "expo run:android",
    "ios": "expo run:ios --device 'iPhone 16'",
    "ios2": "expo run:ios --device 'iPhone 16 Pro'",
    "web": "expo start --web",
    "test": "jest --watchAll",
    "lint": "expo lint"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "^14.0.2",
    "@gorhom/bottom-sheet": "^5",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "1.23.1",
    "@react-native-community/datetimepicker": "8.2.0",
    "@react-native-community/slider": "4.5.5",
    "@react-native-firebase/analytics": "^21.6.1",
    "@react-native-firebase/app": "^21.6.1",
    "@react-native-firebase/auth": "^21.6.1",
    "@react-native-firebase/firestore": "^21.6.1",
    "@react-native-firebase/storage": "^21.6.1",
    "@react-native-google-signin/google-signin": "^13.1.0",
    "@react-navigation/native": "^7.0.14",
    "date-fns": "^4.1.0",
    "expo": "^52.0.23",
    "expo-apple-authentication": "~7.1.2",
    "expo-auth-session": "~6.0.1",
    "expo-build-properties": "~0.13.1",
    "expo-constants": "~17.0.3",
    "expo-font": "~13.0.2",
    "expo-image-picker": "~16.0.3",
    "expo-linear-gradient": "~14.0.1",
    "expo-linking": "~7.0.3",
    "expo-router": "~4.0.15",
    "expo-splash-screen": "~0.29.18",
    "expo-status-bar": "~2.0.0",
    "expo-system-ui": "~4.0.6",
    "expo-web-browser": "~14.0.1",
    "firebase": "^10.14.0",
    "jotai": "^2.10.4",
    "react": "18.3.1",
    "react-dom": "18.3.1",
    "react-native": "0.76.5",
    "react-native-date-picker": "^5.0.7",
    "react-native-element-dropdown": "^2.12.1",
    "react-native-gesture-handler": "~2.20.2",
    "react-native-google-mobile-ads": "^14.8.0",
    "react-native-iap": "^12.15.7",
    "react-native-paper": "^5.12.5",
    "react-native-reanimated": "~3.16.1",
    "react-native-safe-area-context": "4.12.0",
    "react-native-screens": "~4.4.0",
    "react-native-table-component": "^1.2.2",
    "react-native-toast-message": "^2.2.1",
    "react-native-vertical-slider": "^1.0.1",
    "react-native-video": "^6.8.2",
    "react-native-web": "~0.19.13",
    "react-native-webview": "13.12.5"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/jest": "^29.5.12",
    "@types/react": "~18.3.12",
    "@types/react-test-renderer": "^18.0.7",
    "jest": "^29.2.1",
    "jest-expo": "~52.0.2",
    "react-test-renderer": "18.2.0",
    "typescript": "~5.3.3"
  },
  "private": true
}

@dylancom
Copy link
Collaborator

dylancom commented Jan 4, 2025

Got the error while upgrading from Expo 50 to Expo 51.
Caused by: https://github.com/invertase/react-native-google-mobile-ads/blob/main/src/specs/modules/NativeGoogleMobileAdsNativeModule.ts#L61

readonly onAdEvent: EventEmitter<NativeAdEventPayload>;

As far as I understand the error occurs because TurboModule interfaces only support functions as properties (in the react-native version used in 51).

@wjaykim any ideas how to fix?

@wjaykim
Copy link
Collaborator

wjaykim commented Jan 7, 2025

Hmm... The EventEmitter codgen type is added in 0.76.2(facebook/react-native@20b1415, cherry picked commit: facebook/react-native@a09df75), so if it's the reason, it is breaking change(developers must use rn 0.76.2 or higher version) 🤦🏻‍♂️.

@wjaykim
Copy link
Collaborator

wjaykim commented Jan 7, 2025

Too many arguments for public constructor ViewGroupManager<T : ViewGroup!>() defined in com.facebook.react.uimanager.ViewGroupManager

Also, above android build error mentioned in #684 is caused by new ViewGroupManager constructor added in rn 0.75 (facebook/react-native@9066308)

Maybe we have to add compatibility layer or mark the change as breaking?

@dylancom
Copy link
Collaborator

dylancom commented Jan 7, 2025

@wjaykim would be great if we could add a compatibility layer.

@ChristopherBanas
Copy link
Author

ChristopherBanas commented Jan 8, 2025

[!] CocoaPods could not find compatible versions for pod "Google-Mobile-Ads-SDK":
[INSTALL_PODS]   In Podfile:
[INSTALL_PODS]     RNGoogleMobileAds (from `../node_modules/react-native-google-mobile-ads`) was resolved to 14.8.0, which depends on
[INSTALL_PODS]       Google-Mobile-Ads-SDK (= 11.13.0)
[INSTALL_PODS] None of your spec sources contain a spec satisfying the dependency: `Google-Mobile-Ads-SDK (= 11.13.0)`.

🤔 that version for the underlying native SDK looks suspicious - looks like you are trying to use the version of this react-native module as the version for the native SDK, which is a separate thing with it's own version train, based on the version being the same as our react-native module:

"react-native-google-mobile-ads": "^14.8.0",

whereas in cocoapods it is v11.13.0 https://cocoapods.org/pods/Google-Mobile-Ads-SDK

https://github.com/CocoaPods/Specs/blob/0a19dc0d5c3e019c1b14be6496c81dc8ad905b07/Specs/5/9/a/Google-Mobile-Ads-SDK/11.13.0/Google-Mobile-Ads-SDK.podspec.json#L68

And we define 11.13.0 as well

"googleMobileAds": "11.13.0",

You have done something wrong with an override of the version I think @ChristopherBanas - in your Podfile. You should investigate and you will likely find that you have specified a version and it is wrong ?

if defined?($RNGoogleMobileAdsSDKVersion)
Pod::UI.puts "#{s.name}: Using user specified Google Mobile-Ads SDK version '#{$RNGoogleMobileAdsSDKVersion}'"
google_mobile_ads_sdk_version = $RNGoogleMobileAdsSDKVersion
end

Update on this. Running this locally was causing my builds to fail with the issue I linked. When I did it on remotely (not with --local flag it built as expected). Looking into this further but theres probably something cached on my local machine. Real head scratcher

@M4rcoToni
Copy link

I’m experiencing the same issue with Expo SDK 51 and react-native-google-mobile-ads (version 14.2.0).

The builds for both Android and iOS suddenly stopped working, even though no changes were made to the code or configuration.

@mikehardy
Copy link
Collaborator

@M4rcoToni ..... which matches exactly what this issue describes. And there's a known workaround of either not updating to the version with native ads that is inadvertently breaking, or upgrading your Expo. So did you do that? And did it work?

wjaykim added a commit that referenced this issue Jan 11, 2025
Updated codes to include generated native code by codegen(Reference: https://reactnative.dev/docs/the-new-architecture/codegen-cli#including-generated-code-into-libraries).
By doing this, as the generated code is always included in npm artifact(and not rely on the app to run codegen for us), we can support lower react native(or @react-native/codegen) version.

Also removed unnecessary constructor passing contexts in classes extending ViewGroupManager, which breaks build in rn version lower than 0.75.

Fixes #678
@wjaykim wjaykim linked a pull request Jan 11, 2025 that will close this issue
8 tasks
@buraks
Copy link

buraks commented Jan 13, 2025

I am getting

JNI DETECTED ERROR IN APPLICATION: JNI IsAssignableFrom called with pending exception java.lang.NoSuchMethodError: no non-static method
"Lio/invertase/googlemobileads/ReactNativeGoogleMobileAdsNativeModule;.setEventEmitterCallback(Lcom/facebook/react/bridge/CxxCallbackImpl;)V"

I am on the latest version of Expo and react-native that comes with it.

"expo": "~52.0.25",
"react-native": "0.76.6",
"react-native-google-mobile-ads": "^14.8.0",

The exact same code works on Pixel 2 with Android 11, the crash happens on Android 8.

Is this related to the new Native Ad support?

@buraks
Copy link

buraks commented Jan 13, 2025

Switching back to

"react-native-google-mobile-ads": "~14.7.2",

Solves the crash for me.

@ChristopherBanas
Copy link
Author

I am getting

JNI DETECTED ERROR IN APPLICATION: JNI IsAssignableFrom called with pending exception java.lang.NoSuchMethodError: no non-static method
"Lio/invertase/googlemobileads/ReactNativeGoogleMobileAdsNativeModule;.setEventEmitterCallback(Lcom/facebook/react/bridge/CxxCallbackImpl;)V"

I am on the latest version of Expo and react-native that comes with it.

"expo": "~52.0.25",
"react-native": "0.76.6",
"react-native-google-mobile-ads": "^14.8.0",

The exact same code works on Pixel 2 with Android 11, the crash happens on Android 8.

Is this related to the new Native Ad support?

maybe submit a new issue? this issue is turning into a catch all for a lot of unrelated issues

@ChristopherBanas
Copy link
Author

@mikehardy do you think we can close this issue? the specific one I had has been solved and you gave good explanations on how to fix it

@Tieu-Mai-Nhi

This comment has been minimized.

@odaytelbany

This comment has been minimized.

@mikehardy

This comment has been minimized.

@mikehardy
Copy link
Collaborator

mikehardy commented Jan 17, 2025

I'm going to leave this open because people should know it is still an issue even if there is a workaround.
But I'm going to lock conversation as there is nothing further that will be productive.

If you can use react-native 0.76+ (which implies Expo 52+) - great! It will work.

If you must use react-native 0.75 or lower (that is, Expo 51 or lower) then your build will break with react-native-google-mobile-ads 14.8.0+

You must not use anything newer than 14.7.2 until we either make it backwards compatible or you can upgrade react-native.

(note: we plan to issue a 14.8.1 that reverts native ads then re-issue as v15.0.0 to clearly mark the semantic version break, and I/we are sorry that 14.8.0 inadvertently broke older react-native versions. We understand it isn't great. We haven't had time to do this yet though, apologies)

@invertase invertase locked as resolved and limited conversation to collaborators Jan 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.