Flutterfire: [firebase_admob] Upgrade SDK version from 18.1.1 to 19.1.0

Created on 14 May 2020  路  6Comments  路  Source: FirebaseExtended/flutterfire

The firebase_admob package version 0.9.3+2 uses SDK 18.1.1 on Android, which was released almost a year ago. I can see the following line in the build.gradle file:
dependencies {
api 'com.google.firebase:firebase-ads:18.1.1'
}

But the Google Mobile Ads SDK is already in version 19.1.0:
https://developers.google.com/admob/android/rel-notes

Can you estimate when this version will become available? Is it safe to manually edit the line from "flutter.pub-cache\hosted\pub.dartlang.org\firebase_admob-0.9.3+2\android\build.gradle" to use the latest version of the SDK?

We're using Open Bidding Beta, and we need to use the latest version to avoid adding extra parameters to the AndroidManifest.xml.

Thanks.

admob enhancement

Most helpful comment

Adding on top of this, when we try to add the adapters of third party networks like AppLovin or AdColony via gradle, which is required to add them to the bidding process, we get an error due to incompatible dependencies:

Could not determine the dependencies of task ':app:preReleaseBuild'.
In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[17.0.0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.android.gms:play-services-measurement-api:17.0.0 -> com.google.android.gms:play-services-measurement-sdk-api@[17.0.0], but play-services-measurement-sdk-api version was 17.1.0.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the artifact with the issue.
-- Project 'app' depends on project 'firebase_admob' which depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.ads.mediation:[email protected]
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends on project 'firebase_analytics' which depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.ads.mediation:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]

Their adapters require the lastest version of the Google Mobile Ads SDK. Do you have any recommendation for this case?

All 6 comments

Adding on top of this, when we try to add the adapters of third party networks like AppLovin or AdColony via gradle, which is required to add them to the bidding process, we get an error due to incompatible dependencies:

Could not determine the dependencies of task ':app:preReleaseBuild'.
In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[17.0.0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.android.gms:play-services-measurement-api:17.0.0 -> com.google.android.gms:play-services-measurement-sdk-api@[17.0.0], but play-services-measurement-sdk-api version was 17.1.0.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the artifact with the issue.
-- Project 'app' depends on project 'firebase_admob' which depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.ads.mediation:[email protected]
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends on project 'firebase_analytics' which depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.ads.mediation:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:[email protected]

Their adapters require the lastest version of the Google Mobile Ads SDK. Do you have any recommendation for this case?

I can attest to what is written above, trying to add the latest mediation adapters(FAN etc.) to an Android project is not pretty. If a newer version of the AdMob SDK was used it would make everything go a lot smoother.

I'm facing this issue now, can someone help me which version I should add to work adcolony?

@spremathilaka There's probably a way you could hack this by using resolutionStrategy.force in your build.gradle but I would suggest against it. I did it in a React Native project a couple of years ago and it became really annoying to maintain - not to mention this kind of solution won't help with the iOS side.

I recently added mediation to a Flutter project this week and this is what I did:

  • Removed the firebase_admob library from my pubspec.yaml
  • Added the native iOS dependency to my Podfile
  • Added native(Swift) calls to load/show ads and the relevant MethodChannel calls in Dart
  • Added the mediation adapters to my Podfile

You could do the same on Android above you'd just add the dependencies to your build.gradle file instead. This obviously won't help with banners either only interstitials.

I would rather just use firebase_admob than do the above but the version of AdMob it uses is too outdated and it causes all sorts of conflict issues with the latest mediation adapters.

@spremathilaka Our app is using adcolony:3.3.8.1 and working fine with firebase_admob, but adcolony:3.3.11.0 should work with SDK version 18.1.1 too according to the adcolony android mediation adapter changelog.

If you want to add other adnetworks, I recommend looking through the changelog and search for the version that lists minimum required Google Mobile Ads SDK version to 18.1.1 or lower until this issue gets resolved.

any updates here?

Was this page helpful?
0 / 5 - 0 ratings