Reputation: 11
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
Reputation: 21
I had a very similar issue. I used the following steps:
flutter\.pub-cache\hosted\pub.dartlang.org
admob_flutter-...
flutter pub get
The issue is gone :)
Upvotes: 0
Reputation: 11
Delete the admob_flutter-0.3.4 folder in the directory: ..\flutter.pub-cache\hosted\pub.dartlang.org
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