Bbang hoju
Bbang hoju

Reputation: 11

Flutter Android compile issue with admob_flutter-0.3.4 AdmobFlutterPlugin.kt: (46, 33): Overload resolution ambiguity and Type inference failed

After upgrading to Android Gradle Plugin 4.0.0, Gradle Version 6.1.1, I got these errors with AdmobFlutter Plugin in the KT code:

...admob_flutter-0.3.4\android\src\main\kotlin\com\shatsy\admobflutter\AdmobFlutterPlugin.kt: "Overload resolution ambiguity: public final fun initialize(p0: Context!, p1: ((InitializationStatus!) -> Unit)!): Unit defined in com.google.android.gms.ads.MobileAds public open fun initialize(p0: Context!, p1: OnInitializationCompleteListener!): Unit defined in com.google.android.gms.ads.MobileAds public open fun initialize(p0: Context!, p1: String!): Unit defined in com.google.android.gms.ads.MobileAds"

and a second error: ...admob_flutter-0.3.4\android\src\main\kotlin\com\shatsy\admobflutter\AdmobFlutterPlugin.kt: (46, 58): "Type inference failed: Not enough information to infer parameter T in fun arguments(): T! Please specify it explicitly."

I'm fairly new to Flutter/Dart. I haven't used Kotlin before.And it's a plugin, so I don't think I should be poking around in it too much. Would love some help of what to do.

Upvotes: 0

Views: 327

Answers (2)

Alexandr
Alexandr

Reputation: 21

I had a very similar issue. I used the following steps:

  1. Go to the Flutter directory: flutter\.pub-cache\hosted\pub.dartlang.org
  2. Remove all folders that start with: admob_flutter-...
  3. In the terminal run: flutter pub get

The issue is gone :)

Upvotes: 0

Bbang hoju
Bbang hoju

Reputation: 11

  1. Delete the admob_flutter-0.3.4 folder in the directory: ..\flutter.pub-cache\hosted\pub.dartlang.org

  2. re do "Pub get" for pubspec.yaml.

The problem no longer occurs at compile. Perhaps there was some error in the cache files??

Upvotes: 1

Related Questions