Admob extension on Android

Hello!

I’ve been trying to integrate admob with the native extension but I have some questions:

  1. I don’t really know anything about platforms and architectures. For the Android lib, I grabbed the “c++” folder inside “armeabi-v7a” from the Firebase C++ SDK and renamed it to “armv7-android”. Is this ok?

  2. I’m getting an error when compiling the project, most lines refer to an undefined reference to a functions such as “firebase/admob/client/cpp/src/common/admob_common.cc:15: error: undefined reference to ‘firebase::App::GetInstance()’”.
    I’ve read that I have to link the admob lib (libadmob.a) before the firebase app lib (libapp.a), how can I do that?

5 Likes

Hi @echiang07!

Regarding #1, I seem to recall that’s the way we did it.

As for #2, I’m actually fixing that issue right now, so in should be in version 1.2.101.

Currently, there’s no good workaround, however, as a (very) hacky workaround until then, you could try renaming the libraries “a.a” and “b.a” to be able to sort the libraries. This is a hack, and I cannot guarantee that it’ll work, since ultimately, it’s the IO on the server that determines the final order :slight_smile:

5 Likes

I see! Renaming the libraries to a and b did clear most of the errors but some undefined references were still left, thanks for the help still! By the way, is the “DLIB_LOG_DOMAIN is not defined” warning shown whenever there is a compilation error?

1 Like

That’s just a warning that you can ignore for now. I’ll remove that one as well :slight_smile:
The warnings are unfortunately only seen when there’s an error. Ideally, they should be available after each compilation.

What unresolved symbols did you get in your last attempt?

3 Likes

The error says:
“myextension.cpp:firebase::admob_ref: error: undefined reference to ‘firebase::g_admob_initializer’”

Ok, well, I’m not sure why it wouldn’t link then :confused:

Can you share your code?
Maybe separate empty project with admob library.

It is already an empty project since I want to understand the extension system well before putting it into our project. I don’t really have anything besides the headers #include since I couldn’t link the libraries yet, everything else is copied from the myextension example in the manuals.