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
673 stars 135 forks source link

[🐛] ReactNativeGoogleMobileAdsFullScreenAdModule.kt 'onAdLoaded' overrides nothing #511

Closed RonJones32 closed 6 months ago

RonJones32 commented 9 months ago

What happened?

Hello, I am trying to implement Google Ads with React Native and am getting the error that is the subject of this message. More specifically, when trying to implement, I get a compilation error that describes that the full screen ad module has no override for the method onAdLoaded. This error persists whether I try to import the ad modules or not. I am using react-native-google-mobile-ads with min sdk 21 and compile sdk 33. This error is on android. I have verified my appId. This error persists on any device.

Screenshot 2023-12-30 at 9 37 58 AM

Platforms

Android, but have not tested behavior on iOS

React Native Info

zsh: command not found: react-native

Are your using Typescript?

package.json

{
  "name": "ATHApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-firebase/app": "^18.3.0",
    "@react-native-firebase/auth": "^18.3.0",
    "@react-native-firebase/database": "^18.3.0",
    "@react-native-firebase/messaging": "^18.3.0",
    "@react-native-firebase/storage": "^18.3.0",
    "@react-navigation/bottom-tabs": "^6.5.9",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/stack": "^6.3.17",
    "@zegocloud/zego-uikit-prebuilt-live-streaming-rn": "^2.1.1",
    "@zegocloud/zego-uikit-rn": "^2.5.1",
    "date-fns": "^2.30.0",
    "firebase": "^10.1.0",
    "memoize-one": "^6.0.0",
    "react": "18.2.0",
    "react-delegate-component": "^1.0.0",
    "react-native": "0.72.3",
    "react-native-dialog": "^9.3.0",
    "react-native-dialog-input": "^1.0.8",
    "react-native-email": "^2.1.0",
    "react-native-fast-image": "^8.6.3",
    "react-native-fbads": "^7.1.1",
    "react-native-fbsdk-next": "^12.1.2",
    "react-native-flipper": "^0.211.0",
    "react-native-flurry-sdk": "^8.3.0",
    "react-native-geocoding": "^0.5.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-get-location": "^4.0.0",
    "react-native-google-mobile-ads": "^12.6.0",
    "react-native-image-picker": "^5.6.1",
    "react-native-maps": "^1.7.1",
    "react-native-navigation": "^7.37.0",
    "react-native-prompt-android": "^1.1.0",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "^3.6.0",
    "react-native-safe-area-context": "^4.7.1",
    "react-native-screens": "^3.24.0",
    "react-native-track-player": "^4.0.1",
    "react-native-vector-icons": "^10.0.3",
    "react-native-video-player": "^0.14.0",
    "react-native-webview": "^13.6.2",
    "react-navigation": "^4.4.4",
    "tslib": "^2.6.2",
    "zego-express-engine-reactnative": "^3.2.0",
    "zego-zim-react-native": "^2.7.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/eslint-config": "^0.72.2",
    "@react-native/metro-config": "^0.72.9",
    "@tsconfig/react-native": "^3.0.2",
    "@types/jest": "^29.5.3",
    "@types/react": "^18.2.20",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.2.1",
    "eslint": "^8.19.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "0.76.7",
    "prettier": "^2.4.1",
    "react-test-renderer": "18.2.0",
    "typescript": "^4.9.5"
  },
  "engines": {
    "node": ">=16"
  }
}

app.json

{
  "name": "ATHApp",
  "displayName": "ATHApp",
  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-2942063685153483~8530610605"
  }
}

ios/Podfile

N/A

android/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        RNNKotlinVersion = "1.9.0"
        buildToolsVersion = "33.0.0"
        minSdkVersion = 21
        compileSdkVersion = 33
        targetSdkVersion = 33
        kotlin_version = "1.9.0"
        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
    }
    repositories {
        google()
        mavenLocal()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath 'com.google.gms:google-services:4.3.15'
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
  repositories {
   google()
    mavenLocal()
   mavenCentral()
    maven {
      // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
      url "$rootDir/../node_modules/react-native/android"
    }
   maven { url 'https://jitpack.io' }
  }
}

android/app/build.gradle

apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: 'base'
apply plugin: 'com.google.gms.google-services'
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
/**
 * This is the configuration block to customize your React Native Android app.
 * By default you don't need to apply any configuration, just uncomment the lines you need.
 */
react {
    /* Folders */
    //   The root of your project, i.e. where "package.json" lives. Default is '..'
    // root = file("../")
    //   The folder where the react-native NPM package is. Default is ../node_modules/react-native
    // reactNativeDir = file("../node_modules/react-native")
    //   The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
    // codegenDir = file("../node_modules/@react-native/codegen")
    //   The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
    // cliFile = file("../node_modules/react-native/cli.js")

    /* Variants */
    //   The list of variants to that are debuggable. For those we're going to
    //   skip the bundling of the JS bundle and the assets. By default is just 'debug'.
    //   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
    // debuggableVariants = ["liteDebug", "prodDebug"]

    /* Bundling */
    //   A list containing the node command and its flags. Default is just 'node'.
    // nodeExecutableAndArgs = ["node"]
    //
    //   The command to run when bundling. By default is 'bundle'
    // bundleCommand = "ram-bundle"
    //
    //   The path to the CLI configuration file. Default is empty.
    // bundleConfig = file(../rn-cli.config.js)
    //
    //   The name of the generated asset file containing your JS bundle
    // bundleAssetName = "MyApplication.android.bundle"
    //
    //   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
    // entryFile = file("../js/MyApplication.android.js")
    //
    //   A list of extra flags to pass to the 'bundle' commands.
    //   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
    // extraPackagerArgs = []

    /* Hermes Commands */
    //   The hermes compiler command to run. By default it is 'hermesc'
    // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
    //
    //   The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
    // hermesFlags = ["-O", "-output-source-map"]
}

/**
 * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
 */
def enableProguardInReleaseBuilds = true

/**
 * The preferred build flavor of JavaScriptCore (JSC)
 *
 * For example, to use the international variant, you can use:
 * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
 *
 * The international variant includes ICU i18n library and necessary data
 * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
 * give correct results when using with locales other than en-US. Note that
 * this variant is about 6MiB larger per architecture than default.
 */
def jscFlavor = 'org.webkit:android-jsc:+'

android {
    ndkVersion rootProject.ext.ndkVersion

    compileSdkVersion rootProject.ext.compileSdkVersion

    namespace "com.*****"

    defaultConfig {
        applicationId "com.*******"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 2
        versionName "1.1"
        vectorDrawables.useSupportLibrary = true
        }

    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://reactnative.dev/docs/signed-apk-android.
            signingConfig signingConfigs.debug
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
}

dependencies {
    // The version of react-native is set by the React Native Gradle Plugin
    implementation project(':react-native-gesture-handler')
    implementation(platform("com.google.firebase:firebase-bom:32.2.2"))
    implementation 'com.facebook.android:facebook-android-sdk:[8,9)'
    implementation("com.facebook.react:react-android")
    implementation("com.google.firebase:firebase-auth")
    implementation('com.facebook.android:audience-network-sdk:6.+')
    implementation 'com.google.android.gms:play-services-ads:22.6.0'
    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }

    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
    if (hermesEnabled.toBoolean()) {
        implementation("com.facebook.react:hermes-android")
    } else {
        implementation jscFlavor
    }
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

android/settings.gradle

rootProject.name = '*******'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
include ':@react-native-firebase_auth'
project(':@react-native-firebase_auth').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/auth/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/android')

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <!-- Permissions required by the SDK -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Permissions required by the App -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
  android:name="com.facebook.ads.InterstitialAdActivity"
  android:configChanges="keyboardHidden|orientation" />
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
       <meta-data
     android:name="com.google.android.geo.API_KEY"
     android:value="******************"/>
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
    <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="*******************"/>
    </application>
</manifest>
Sygn53 commented 8 months ago

Hi @RonJones32 before => abstract class ReactNativeGoogleMobileAdsFullScreenAdModule T replace => abstract class ReactNativeGoogleMobileAdsFullScreenAdModule T : Any < > don't forget these too

If you do this, the error will be fixed, but it will need to be done again with each package installation.

RonJones32 commented 8 months ago

@Sygn53

`BUILD FAILED in 12s error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.kt:31:59 Too many arguments for public constructor ReactNativeGoogleMobileAdsFullScreenAdModule() defined in io.invertase.googlemobileads.ReactNativeGoogleMobileAdsFullScreenAdModule e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.kt:31:73 Too many arguments for public constructor ReactNativeGoogleMobileAdsFullScreenAdModule() defined in io.invertase.googlemobileads.ReactNativeGoogleMobileAdsFullScreenAdModule e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.kt:33:3 'getAdEventName' overrides nothing e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.kt:39:5 Unresolved reference: load e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.kt:46:5 Unresolved reference: show e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.kt:49:3 'loadAd' overrides nothing e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:38:15 Unexpected type specification e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:38:40 Expecting ')' e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:39:13 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:39:15 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:1 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:3 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:5 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:22 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:23 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:35 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:37 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:47 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:49 Expecting a top level declaration e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:37:66 Unresolved reference: any e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:38:3 Unresolved reference: reactContext e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:39:3 Unresolved reference: moduleName e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:40:49 Function declaration must have a name e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:41:3 Modifier 'private' is not applicable to 'local variable' e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:41:37 Unresolved reference: T e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:43:3 Modifier 'abstract' is not applicable to 'local function' e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:45:3 Modifier 'abstract' is not applicable to 'local function' e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:49:36 Unresolved reference: T e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:52:3 Modifier 'private' is not applicable to 'local function' e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:72:20 Unresolved reference: currentActivity e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:90:26 Unresolved reference: ReactNativeGoogleMobileAdsAdLoadCallback e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:108:20 Unresolved reference: currentActivity e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:110:7 Unresolved reference: rejectPromiseWithCodeAndMessage e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:127:33 Cannot infer a type for this parameter. Please specify it explicitly. e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:143:3 Modifier 'inner' is not applicable to 'local class' e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:147:22 Unresolved reference: T e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:148:33 Unresolved reference: T e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:169:44 Variable expected e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:170:30 Variable expected e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:171:31 Variable expected e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:172:43 Variable expected e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:198:42 Cannot infer a type for this parameter. Please specify it explicitly. e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsFullScreenAdModule.kt:198:48 Cannot infer a type for this parameter. Please specify it explicitly. e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.kt:32:73 Too many arguments for public constructor ReactNativeGoogleMobileAdsFullScreenAdModule() defined in io.invertase.googlemobileads.ReactNativeGoogleMobileAdsFullScreenAdModule e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.kt:32:87 Too many arguments for public constructor ReactNativeGoogleMobileAdsFullScreenAdModule() defined in io.invertase.googlemobileads.ReactNativeGoogleMobileAdsFullScreenAdModule e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.kt:34:3 'getAdEventName' overrides nothing e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.kt:40:5 Unresolved reference: load e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.kt:47:5 Unresolved reference: show e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.kt:50:3 'loadAd' overrides nothing e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedInterstitialModule.kt:32:72 Too many arguments for public constructor ReactNativeGoogleMobileAdsFullScreenAdModule() defined in io.invertase.googlemobileads.ReactNativeGoogleMobileAdsFullScreenAdModule e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedInterstitialModule.kt:32:86 Too many arguments for public constructor ReactNativeGoogleMobileAdsFullScreenAdModule() defined in io.invertase.googlemobileads.ReactNativeGoogleMobileAdsFullScreenAdModule e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedInterstitialModule.kt:34:3 'getAdEventName' overrides nothing e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedInterstitialModule.kt:40:5 Unresolved reference: load e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedInterstitialModule.kt:47:5 Unresolved reference: show e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedInterstitialModule.kt:50:3 'loadAd' overrides nothing e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.kt:32:60 Too many arguments for public constructor ReactNativeGoogleMobileAdsFullScreenAdModule() defined in io.invertase.googlemobileads.ReactNativeGoogleMobileAdsFullScreenAdModule e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.kt:32:74 Too many arguments for public constructor ReactNativeGoogleMobileAdsFullScreenAdModule() defined in io.invertase.googlemobileads.ReactNativeGoogleMobileAdsFullScreenAdModule e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.kt:34:3 'getAdEventName' overrides nothing e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.kt:40:5 Unresolved reference: load e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.kt:47:5 Unresolved reference: show e: file:///Users/ronaldjones/Documents/Apps/ATHApp/node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.kt:50:3 'loadAd' overrides nothing FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-google-mobile-ads:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction > Compilation error. See log for more details`

Sygn53 commented 8 months ago

Screenshot 2024-01-15 at 11 21 30 If you do this it will be ok. Do yarn or npm install first Have a nice day :) @RonJones32 If it still doesn't work, add this to app build gradle; buildscript { ext { ... kotlin_version = '1.9.21' } }

RonJones32 commented 8 months ago

@Sygn53 /node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsRewardedModule.kt:50:3 'loadAd' overrides nothing FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-google-mobile-ads:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction > Compilation error. See log for more details Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org BUILD FAILED in 27s.

inckie commented 8 months ago

Correct signature for latest Kotlin is override fun onAdLoaded(ad: T & Any)

RonJones32 commented 8 months ago

@inckie what about "loadAD"? Same error

github-actions[bot] commented 7 months ago

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.

RonJones32 commented 7 months ago

@github-actions still requires attention

mikehardy commented 7 months ago

Attention == PR, if you propose a PR we can merge it and close it

Note that most people likely are not hitting this because the majority of the react-native ecosystem (and indeed any project still created by the current react-native template in 0.73.x is on kotlin 1.8

I believe this is a kotlin 1.9 change

github-actions[bot] commented 6 months ago

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.

RonJones32 commented 6 months ago

Requires attention still

Ron Jones Jr Sr. Mobile Developer CEO of Collective Minds Inc Owner of Are They Hooping

On Sun, Mar 17, 2024 at 11:38 PM github-actions[bot] < @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/invertase/react-native-google-mobile-ads/issues/511#issuecomment-2002870644, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL2M7BFYZ2OOQU3GNI52O43YYZOUTAVCNFSM6AAAAABBHSBQ2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSHA3TANRUGQ . You are receiving this because you were mentioned.Message ID: @.*** com>

mikehardy commented 6 months ago

Just merged a fix here thanks to @YannickBruening 👏