Admob and Firebase Analytics extensions (SOLVED)

I’ve these dependencies:

ADMOB (only this, without any addictional previuos needed dependencies)
https://github.com/Lerg/extension-admob/archive/dev.zip

FIREBASE (only this, without any addictional previuos needed dependencies)
https://github.com/defold/extension-firebase/archive/master.zip

RENDERCAM (this is not native is ininfluent?!?!)

I’ve ready minimal repro case:

Admob&Firebase.zip (74.7 KB)

errorlog.txt (7.9 KB)

@lrx If identified the problem: We used the wrong dependencies for Firebase Analytics. I’ve released a new version. Please test this version together with AdMob.

3 Likes

Wooorks :heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes:

3 Likes

Yes, happy to hear that it is working! The time spent adding gradle is definitely worth it. We may still run into extensions with conflicting dependencies, but all other cases should now be handled smoothly.

2 Likes

Maybe you can build a Defold BOM for android dependencies or define dependencies constraints in build cloud server.

So native extensions can avoid to specify exact version of shared android libraries.

It’s a good idea?

1 Like

Maybe. With the basic gradle support we have in 1.2.165 we solve most of the problems we have had in the past with transitive dependencies. I’m confident that this will make Android extension development a whole lot easier. If we still run into problems we may need to look into some of the things you suggested.

2 Likes

I’m using Firebase Analytics in my project and it works on iOS and Android.

After also adding the Admob extension, I get a build error when exporting to iOS. Exporting to Android works fine.

I created a test app with only the Admob and Firebase extensions in, which produces the same error when both extensions are included:

Undefined symbols for architecture armv7:
  "_kAPMSafelistedEventsOptionKey", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_1423240b22a8d04880a5570a49fcf86d.o)
  "_kAPMMonitorLogTagOptionKey", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_1423240b22a8d04880a5570a49fcf86d.o)
  "_kAPMAnalyticsConfiguration", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_1423240b22a8d04880a5570a49fcf86d.o)
  "_kAPMIsAnalyticsCollectionDeactivated", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_1423240b22a8d04880a5570a49fcf86d.o)
  "_kAPMAppMeasurementOriginFirebase", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_1423240b22a8d04880a5570a49fcf86d.o)
  "_kAPMIsAnalyticsCollectionEnabled", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_1423240b22a8d04880a5570a49fcf86d.o)
	ld: symbol(s) not found for architecture armv7
	clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

  /admob/src/extension.cpp
	Line 36: enumeration values 'EVENT_ID_ICONIFYAPP' and 'EVENT_ID_DEICONIFYAPP' not handled in switch [-Wswitch]
        switch (event->m_Event) {
                ^

                /firebase/src/firebase.cpp
	Line 3: 'DLIB_LOG_DOMAIN' macro redefined [-Wmacro-redefined]
#define DLIB_LOG_DOMAIN LIB_NAME
        ^
	Line 3: previous definition is here
#define DLIB_LOG_DOMAIN "FIREBASE"
        ^
	Line 36: extra tokens at end of #else directive [-Wextra-tokens]
#else if defined(DM_PLATFORM_IOS)
      ^
      //
	Line 165: format string is not a string literal (potentially insecure) [-Wformat-security]
                        luaL_error(L, msg);
                                      ^~~
	Line 165: treat the string as an argument to avoid this
                        luaL_error(L, msg);
                                      ^
                                      "%s",
	Line 185: format string is not a string literal (potentially insecure) [-Wformat-security]
                                luaL_error(L, msg);
                                              ^~~
	Line 185: treat the string as an argument to avoid this
                                luaL_error(L, msg);
                                              ^
                                              "%s",

It builds fine with only the Firebase extension OR only the Admob extension.

Project config:

Admob config:

Defold version:

Did I miss something in the setup, or have I discovered a new issue?

Until we have a cocoapod dependency systems, we will have to resolve dependency conflicts by hand. You have to download either extension and delete a duplicate GoogleAppMeasurement.framework or any other conflicting framework.

1 Like

Oh dear. I am unfamiliar with Defold extension development. Where would I start?!

Just download the extension directory (from the zip file) into your project and look inside lib/ios.

That did the trick! Thanks a lot @sergey.lerg, not as difficult as I imagined.

To recap:

  1. Download and extract the extensions .zip to the root of your project.
  2. Remove .framework folders that exist in the other extension from “admob/lib/ios”. In this case three frameworks were duplicates, leaving only one:

28

3 Likes