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

[🐛] Android - build fail on react-native 0.77 #701

Open
1 task done
philippeauriach opened this issue Jan 30, 2025 · 3 comments
Open
1 task done

[🐛] Android - build fail on react-native 0.77 #701

philippeauriach opened this issue Jan 30, 2025 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@philippeauriach
Copy link

philippeauriach commented Jan 30, 2025

What happened?

Following the update instructions for react native 0.77, and after upgrading to google-mobile-ads 14.8.1, build fail on android.

Fails in two files :

private val delegate: ViewManagerDelegate<ReactNativeGoogleMobileAdsMediaView> = RNGoogleMobileAdsMediaViewManagerDelegate(this)

e: file:///xxx/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsMediaViewManager.kt:34:126 Argument type mismatch: actual type is 'io.invertase.googlemobileads.ReactNativeGoogleMobileAdsMediaViewManager', but 'U!' was expected.

and:

private val delegate: ViewManagerDelegate<ReactNativeGoogleMobileAdsNativeAdView> = RNGoogleMobileAdsNativeViewManagerDelegate(this)

e: file:///xxx/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsNativeAdViewManager.kt:36:130 Argument type mismatch: actual type is 'io.invertase.googlemobileads.ReactNativeGoogleMobileAdsNativeAdViewManager', but 'U!' was expected.

Platforms

Only on Android

React Native Info

System:
  OS: macOS 15.3
  CPU: (16) arm64 Apple M3 Max
  Memory: 8.09 GB / 128.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.17.0
    path: ~/.asdf/installs/nodejs/20.17.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.asdf/installs/nodejs/20.17.0/bin/yarn
  npm:
    version: 10.9.0
    path: ~/.asdf/plugins/nodejs/shims/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/philippeauriach/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23726.103.2422.12816248
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.4
    path: /usr/bin/javac
  Ruby:
    version: 3.1.2
    path: /Users/philippeauriach/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.0
    wanted: 0.77.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: true

Are your using Typescript?

  • My project is using Typescript

package.json

{
  "name": "xxx",
  "version": "1.0.0",
  "private": true,
  "scripts": {
  },
  "resolutions": {
    "axios": "^1.6.7"
  },
  "dependencies": {
    "@formatjs/intl-datetimeformat": "6.17.2",
    "@formatjs/intl-getcanonicallocales": "2.5.4",
    "@formatjs/intl-listformat": "7.7.9",
    "@formatjs/intl-locale": "4.2.9",
    "@hookform/resolvers": "3.10.0",
    "@invertase/react-native-apple-authentication": "2.4.0",
    "@notifee/react-native": "7.9.0",
    "@react-native-async-storage/async-storage": "1.24.0",
    "@react-native-clipboard/clipboard": "1.16.1",
    "@react-native-community/geolocation": "3.4.0",
    "@react-native-community/netinfo": "11.4.1",
    "@react-native-firebase/analytics": "21.7.1",
    "@react-native-firebase/app": "21.7.1",
    "@react-native-firebase/in-app-messaging": "21.7.1",
    "@react-native-firebase/messaging": "21.7.1",
    "@react-native-firebase/remote-config": "21.7.1",
    "jwt-decode": "^4.0.0",
    "lottie-react-native": "7.2.2",
    "luxon": "3.5.0",
    "querystring": "^0.2.1",
    "react": "18.3.1",
    "react-hook-form": "7.54.2",
    "react-i18next": "14.1.3",
    "react-native": "0.77.0",
    "react-native-config": "1.5.3",
    "react-native-date-picker": "5.0.9",
    "react-native-device-info": "11.1.0",
    "react-native-fbsdk-next": "12.2.0",
    "react-native-gesture-handler": "2.22.1",
    "react-native-get-random-values": "1.11.0",
    "react-native-google-mobile-ads": "14.8.1",
    "react-native-haptic-feedback": "2.3.3",
    "react-native-linear-gradient": "2.8.3",
    "react-native-localize": "3.4.1",
    "react-native-logs": "5.3.0",
    "react-native-onesignal": "5.2.8",
    "react-native-permissions": "4.1.5",
    "react-native-rate": "^1.2.12",
    "react-native-reanimated": "3.16.7",
    "react-native-safe-area-context": "5.1.0",
    "react-native-screens": "4.5.0",
    "react-native-share": "12.0.3",
    "react-native-svg": "15.11.1",
    "react-native-toast-message": "2.2.1",
    "react-native-url-polyfill": "^2.0.0",
    "react-native-vector-icons": "10.2.0",
    "react-native-view-shot": "3.8.0",
    "react-native-webview": "13.13.2",
    "recoil": "^0.7.7",
    "use-immer": "0.11.0",
    "uuid": "10.0.0",
    "yup": "1.6.1",
    "zustand": "4.5.6"
  },
  "devDependencies": {
    "@babel/core": "^7.25.2",
    "@babel/preset-env": "^7.25.3",
    "@babel/runtime": "^7.25.0",
    "@crowdin/cli": "^4.5.2",
    "@react-native-community/cli": "15.0.1",
    "@react-native-community/cli-platform-android": "15.0.1",
    "@react-native-community/cli-platform-ios": "15.0.1",
    "@react-native/babel-preset": "0.77.0",
    "@react-native/eslint-config": "0.77.0",
    "@react-native/metro-config": "0.77.0",
    "@react-native/typescript-config": "0.77.0",
    "@types/jest": "^29.5.13",
    "@types/luxon": "^3.4.2",
    "@types/react": "^18.2.6",
    "@types/react-native-vector-icons": "^6.4.18",
    "@types/react-test-renderer": "^18.0.0",
    "@types/uuid": "^10.0.0",
    "@welldone-software/why-did-you-render": "^8.0.3",
    "babel-plugin-module-resolver": "^5.0.0",
    "deepmerge": "^4.3.1",
    "eslint": "^8.57.1",
    "eslint-plugin-import": "^2.31.0",
    "jest": "^29.6.3",
    "orval": "^6.31.0",
    "patch-package": "^8.0.0",
    "postinstall-postinstall": "^2.1.0",
    "prettier": "2.8.8",
    "react-native-svg-transformer": "^1.5.0",
    "react-test-renderer": "18.3.1",
    "sort-package-json": "^2.14.0",
    "typescript": "5.7.3"
  },
  "engines": {
    "node": ">=18"
  }
}

app.json

{
  "name": "xxx",
  "displayName": "xxx",
  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-xxx",
    "ios_app_id": "ca-app-pub-xxx",
    "delay_app_measurement_init": true
  }
}

ios/Podfile

android/build.gradle

buildscript {
    ext {
        buildToolsVersion = "35.0.0"
        minSdkVersion = 24
        compileSdkVersion = 35
        targetSdkVersion = 34

        ndkVersion = "27.1.12297006"
        kotlinVersion = "2.0.21"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
        classpath 'com.google.gms:google-services:4.4.2'
    }
}

apply plugin: "com.facebook.react.rootproject"

android/app/build.gradle

android/settings.gradle

AndroidManifest.xml

@philippeauriach philippeauriach added the help wanted Extra attention is needed label Jan 30, 2025
@stage88
Copy link

stage88 commented Jan 30, 2025

It looks like BaseViewManagerInterface was removed here facebook/react-native@7fb3d83. This interface is used by the RNGoogleMobileAdsMediaViewManagerDelegate.

@stage88
Copy link

stage88 commented Jan 31, 2025

Applying a fix similar to this one seems to have resolved the build problems.

@SumitR9910
Copy link

hey guys any updates on this issue?

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

3 participants