'Flutter build error in the admobflutter package

I am getting a build error while debugging. I have upgraded the package to the latest version : https://pub.dev/packages/audioplayers/install

-- This is the code of where the error is pointing --

package com.shatsy.admobflutter

import android.content.Context
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.StandardMessageCodec
import io.flutter.plugin.platform.PlatformView
import io.flutter.plugin.platform.PlatformViewFactory

  class AdmobBannerFactory(private val messenger: BinaryMessenger): PlatformViewFactory(StandardMessageCodec.INSTANCE) {
    overide fun create(context: Context, viewId: Int, args: Any?): PlatformView {
    return AdmobBanner(context, messenger, viewId, args as HashMap<*, *>)
  }
}

-- This is the error message --

 Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
e: C:\Users\ankit\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\admob_flutter-2.0.0\android\src\main\kotlin\com\shatsy\admobflutter\AdmobBannerFactory.kt: (10, 5): Expecting member declaration
e: C:\Users\ankit\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\admob_flutter-2.0.0\android\src\main\kotlin\com\shatsy\admobflutter\AdmobBannerFactory.kt: (9, 36): Class 'AdmobBannerFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: C:\Users\ankit\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\admob_flutter-2.0.0\android\src\main\kotlin\com\shatsy\admobflutter\AdmobInterstitial.kt: (63, 29): Null can not be a value of a non-null type String
e: C:\Users\ankit\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\admob_flutter-2.0.0\android\src\main\kotlin\com\shatsy\admobflutter\AdmobReward.kt: (66, 29): Null can not be a value of a non-null type String
2

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':admob_flutter:compileDebugKotlin'.
> 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 58s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source