Closed solodon4 closed 2 years ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
P.S. This is probably related to the fact that MobileAds.initialize(Context, String) is deprecated
@solodon4 Thank you for pointing it out!
It does seems like MobileAds.initialize(Context, String) is removed, and C++ SDK is still using it here. https://github.com/firebase/firebase-cpp-sdk/blob/0c8c8b29bc2d62d66c6ac49ff2c3fb04f815a687/admob/src/android/admob_android.cc#L47
That is, ::firebase::admob::Initialize(app, app_id)
is probably no longer safe to use.
Let me consult with the team and see what is the alternatives moving forward.
Shawn
AFAIK, firebase-ads
uses Admob 19, and MobileAds.initialize(Context, String)
is removed in 20.
We actually have integration test for this as well. https://github.com/firebase/firebase-cpp-sdk/blob/3c2190901976a218cd4dc91b0e6aae5afc8d9291/admob/integration_test/src/integration_test.cc#L114
My guess is some of your dependencies may requires admob 20 and Gradle ended up bumping up the version. (Those com.google.ads.mediation
looks pretty suspicious :/)
I'll report this to the team and see what we can do.
Shawn
Thank you @chkuang-g! I did try your hypothesis over the weekend and indeed if I downgrade all 3 of the mediation packages to the last version that depended on admob 19:
// AdMob Mediation
implementation 'com.google.ads.mediation:adcolony:4.4.1.0'
implementation 'com.google.ads.mediation:chartboost:8.2.0.0'
// Mediation Test Suite
implementation 'com.google.android.ads:mediation-test-suite:1.5.0'
the initialization goes through successfully. Apparently all 3 require admob 20 SDK in their latest versions.
Currently Firebase Admob C++ SDK only support Android Admob 19 SDK, since Admob 20 SDK introduced a lot of breaking changes, as you can see now.
Is downgrading the mediation packages an appropriate workaround for you? If not, please let us know your scenario and we can forward the information to the team.
Shawn
Thanks @chkuang-g! Downgrading mediation packages versions certainly unblocks me for now as I can work on other parts of the code, however, I'd need an actual solution to this problem eventually as I can see via mediation test suite warnings about SDK versions of providers as well as an error with one of them. I can live with those for now, but please don't close this bug until you guys fix the underlying issue so that I can track it on my side. Thank you!
Where can we see the current version compatibility between the Firebase C++ sdk and the associated SDKs (especially Google Ads). I don't know where to look for this information, and therefore don't know if it's safe for me to finally move to Google Ads 20 as I'm using firebase_cpp_sdk.
We refreshed and updated the GMA C++ SDK in the Firebase C++ SDK 9.2.0 release. The old firebase::admob
namespace is now deprecated; the new version, in firebase::gma
, has been completely rewritten and now supports the latest AdMob iOS and Android versions.
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the issue here:
When I try to initialize AdMob on Android with either
or
I get the following error and assertion at run-time:
which happens on an actual Android device (Lollipop, API 23) and an emulator (Pixel 4, API 24).
When I run APK analyzer it only shows 2 relevant initialize methods and none of them takes String as second argument:
Based on the call stack I see, my guess is that this is related to these lines in Firebase AdMob code but I can't tell whether it is indeed still a requirement.
Here is the relevant part of the call stack:
This is possibly a regression as I had AdMob properly working with earlier version of Firebase C++ SDK (6.* something). Here are other dependencies I'm using:
What am I possibly doing wrong or is there a workaround if it is indeed a bug on your side?
Steps to reproduce:
Have you been able to reproduce this issue with just the Firebase C++ quickstarts ? What's the issue repro rate? (eg 100%, 1/5 etc)
No, you guys don't keep your samples up to date to be built with recent build tools, side-by-side NDK etc. plus they require too much setup.