Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdMob: Unable to initialize without Google Play Services #127

Closed
mrpuzzler opened this issue Feb 5, 2019 · 6 comments
Closed

AdMob: Unable to initialize without Google Play Services #127

mrpuzzler opened this issue Feb 5, 2019 · 6 comments

Comments

@mrpuzzler
Copy link

Under Android replace:

firebase::admob::Initialize(*app, kAdMobAppID);
with
firebase::admob::Initialize(GetJniEnv(), GetActivity(), kAdMobAppID);

and you get crash, as there is no such method on Android side.

@jonsimantov
Copy link
Contributor

Hi,

The C++ library always requires you to pass in the Firebase App. When you initialize Firebase App on Android, you pass in the JNI environment and activity.

See the AdMob sample app for an example:
https://github.com/firebase/quickstart-cpp/blob/master/admob/testapp/src/common_main.cc#L126

@mrpuzzler
Copy link
Author

I try to use Firebase on Amazon devices without Google Play Services. So I can't init Firebase, as I always get annoying dialog "Update Google Play Services". But, according to docs - there is no need for Firebase to use AdMob.

And AdMob has special constructor for such cases - see admob.h

Looks like you forgot to implement jni-bridge on c++ side to java side. c++ has function, but does not route to java call. It's easy to fix.

@jonsimantov jonsimantov reopened this Feb 6, 2019
@jonsimantov
Copy link
Contributor

Sorry about that. I do see the Initialize() method you described.

It does seem that there is a bug that still looks for the class com.google.android.gms.tasks.Task when you initialize AdMob in that way. Thank you for reporting it, I'll take a look and see what's needed to fix it.

@stewartmiles stewartmiles changed the title Android missing signature AdMob: Unable to initialize without Google Play Services May 6, 2019
@chkuang-g chkuang-g transferred this issue from firebase/quickstart-cpp Sep 2, 2020
@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@mrpuzzler
Copy link
Author

Lol, after almost 1.5 year you still did not fix it, are you serious?

@DellaBitta
Copy link
Contributor

Hi all,

We've since deprecated the AdMob SDK and have replaced it with the Google Mobile Ads (GMA) SDK. 've just tested this and I was able to create an instance of the GMA SDK without Google Play Services. If you do encounter this issue still on the GMA SDK, then please open another ticket and we'll look into it further. Thank you!

@firebase firebase locked and limited conversation to collaborators Sep 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants