Jaydeep Vyas
Jaydeep Vyas

Reputation: 4470

Flutter issue with Google Ads & Firebase Versions

I am using latest version of flutter 3.7.2 My app has google ads and firebase dependency for which is use following pubs latest versions

admob_flutter:
firebase_messaging:
firebase_core:

Everthing is working perfect but when I have uploaded app on playstore it gives me following error

enter image description here

For solution of above warning i done the change in app level gradle file and following line

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.google.android.gms:play-services-ads:21.5.0' // this line added for solution
    implementation platform('com.google.firebase:firebase-bom:29.3.0')
    implementation 'com.google.firebase:firebase-analytics'
}

but after adding above line my firebase stopped working it crash when run app with following errorenter image description here.

NOTE: I have tried flutter clean, reinstall app, flutter pub upgrade everything is up-to date. Also when i change line implementation 'com.google.android.gms:play-services-ads:21.5.0' to implementation 'com.google.android.gms:play-services-ads:19.2.0' everything is working perfect

Upvotes: 1

Views: 542

Answers (2)

Lalo92
Lalo92

Reputation: 11

If you are using 'admob_flutter' and update to 'com.google.android.gms:play-services-ads:2.50.0' you couldn't use Admob, this is because 'admob_flutter' does not support 'play-services-ads:2.50.0'.

In this case, I used 'google_mobile_ads 2.3.0' it's verified and published by 'google.dev

https://pub.dev/packages/google_mobile_ads

Upvotes: 0

Lalo92
Lalo92

Reputation: 11

you help me with the part that you say works with only 'com.google.android.gms:play-services-ads:19.2.0' and I had the same problem but trying to solve it by changing this line:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    api 'com.google.firebase:firebase-ads:21.5.0'
}

you try to change firebase-ads:19.1.0 to 21.5.0 and it will let you use implementation 'com.google.android.gms:play-services-ads:21.5.0'

It works for me, hope helps you.

Upvotes: 1

Related Questions