Admob and Firebase Analytics extensions (SOLVED)

Hi all,

I’m successfully using @sergey.lerg admob extension in Blocks Unlock

Now I want to add Firebase Analytics extension to understand how users are interacting with the game.

Ie: how many levels and words are played, how many moves they used to complete … etc …

The problem by adding both extension is that are using different versions of same dependency:

Admob:

Firebase Analytics :

Android Support v4 library versions are different (26 and 27)

Fixup in Admob Extension gps-ads seems to be conflicting with gps-measurement in Firebase Analytics Extension.

I’m getting errors while bundling:

There are specific version of these extensions can coexists?

Having both Admob and Firebase Analytics is a cornerstone, they are fully integrated in firebase console!

Try using admob dependencies and only add

https://github.com/defold/android-base-extensions/releases/download/1.0.0/firebase-core-16.0.8.zip

for firebase.

Should work I guess.

1 Like

I have just tried, but it does not compile.

I just added

https://github.com/defold/android-base-extensions/releases/download/1.0.0/firebase-core-16.0.8.zip 

:sweat_smile:

It’s com-google-android-gms-play-services-measurement-api-16.5.0.jar inside my gps-ads-17.2.1.zip is conflicting with firebase.
If you extract that zip, remove that jar and add the rest into your project (you can just copy), it should work.

I’ve fixed gps-ads-17.2.1.zip and copied into local IIS to serve as extension.

Now project is bundled, but crashes at runtime :woozy_face:

Argh! What a mess. The missing class is contained in that deleted JAR file.
I don’t know what is the correct way of resolving this. You can go further and repack that JAR file, deleting only the duplicate classes and leaving the rest, but that’s insane.

Maybe you can use facebook extension for analytics? It’s working fine. Either the one by Defold or mine https://github.com/Lerg/extension-facebook.

Facebook Analytics could be an alternative.
But I hope not so far to use Admob with Firebase together :slight_smile:

Hi @sergey.lerg,

I’d like to know if you have some good news about using both Admob and Firebase in the same project.

@Mathias_Westerdahl was talking about a way to simplify this aspect

Unfortunately this issue is also blocking the usage of Push Notifications

Thanks in advance :upside_down_face:

I am using admob, and I have to use some Analytics Tool.

I tried Facebook Analytics following the instructions in here: https://defold.com/manuals/facebook/

I have this problem when building the app:

Failed building Android resources to R.java: /var/folders/g1/317kcvf966b3knjtxc969n980000gn/T/bob_bundle_tmp11395954875322272039/extensions/facebook/com-facebook-android-facebook-common-5.9.0/values/com-facebook-android-values.xml:71: error: Error retrieving parent for item: No resource found that matches the given name ‘@style/Theme.AppCompat.NoActionBar’.

/var/folders/g1/317kcvf966b3knjtxc969n980000gn/T/bob_bundle_tmp11395954875322272039/extensions/facebook/com-facebook-android-facebook-common-5.9.0/values/com-facebook-android-values.xml:76: error: Error retrieving parent for item: No resource found that matches the given name ‘@style/Theme.AppCompat.Dialog’.

So, Facebook Analytics is not an option.

We will release a new Defold version mid January with support for Gradle dependency resolution. This will almost completely eliminate any problems with incompatible extensions. For now it’s a big hassle to get multiple extensions with overlapping dependencies to play well together. My recommendation is to wait one or two weeks until after the release when the extensions have been updated as well.

6 Likes

Try the dev branch of the admob extension with firebase and Defold 165 beta.
https://github.com/Lerg/extension-admob/archive/dev.zip
Remove additional dependencies from the game.project file.

2 Likes

Unfortunately I get this error:

That is an error in our error reporting. Please find the log.txt in your build folder (e.g. build/armv7-android) and see if you can find a better error message.

Wow,

I’ve found these error in log in windows temp folder build_a404b463128a6eecf3d5cce4916180b222488123_17464569530666097379.txt, armv7-android is empty.

/tmp/job18205432844708724708/build/AndroidManifest.xml:23: error: Error: No resource found that matches the given name (at 'description' with value '@string/description').
/tmp/job18205432844708724708/build/AndroidManifest.xml:37: error: Error: No resource found that matches the given name (at 'theme' with value '@style/SplashTheme').

Maybe the first reference (@string/description) may be wrong,
but @style/SplashTheme exists and works!

I’ve remove two lines from my manifest but I’m getting this:

build_a404b463128a6eecf3d5cce4916180b222488123_16484096276431398647.txt (7.9 KB)

Jan 23, 2020 1:32:31 PM com.defold.manifestmergetool.ManifestMergeTool$ILoggerWrapper error
SEVERE: /tmp/job7890539925635341061/upload/AndroidManifest.xml:22:18-91 Error:
	Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from AndroidManifest.xml:22:18-91
	is also present at AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
	Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:12:5-44:19 to override.
Jan 23, 2020 1:32:31 PM com.defold.manifestmergetool.ManifestMergeTool$ILoggerWrapper warning
WARNING: 
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

Jan 23, 2020 1:32:31 PM com.defold.manifestmergetool.ManifestMergeTool main
SEVERE: java.lang.RuntimeException: Failed to merge manifests: com.android.manifmerger.MergingReport@704d6e83

It seems you are misingmixing old android with androidx. In short, make sure your versions match between different libraries.

We are as far as I know not using any dependency which in turn uses androidx in any of the native extensions created by the Defold team. @sergey.lerg is AdMob using a dependency which needs androidx?

No, I think we are stuck with android target 27 for a while, so transitioning to androidx won’t happen soon.

Yes, there is a conflict with the libraries in the extensions.
But I’m not developing these extensions (admob and firebase), I’m trying to use them both in my app.

Can you please share the dependencies from your game.project please?

Our current target api level is 28.