Firebase Analytics

I just released an update on solar2d marketplace

3 Likes
settings =

{
android =
{
strings =
{

	    ["google_app_id"]= "1:example number:android:example number"
	},
    useGoogleServicesJson = true,
},
plugins= {
	["plugin.firebaseAnalytics"] =
	{
	  publisherId="tech.scotth",
	  marketplaceId = "insert marketplace account ID",
	},
},

}.

How to get "marketplaceId "?

@Trung_Kien_Tran,
Following @Scott_Harrison’s Solar2D Marketplace website, you need to set up an account (if not done already) and activate them. The “Account ID” is on your account page on the marketplace. Please see here for his video guide,
https://solar2dmarketplace.com/guide

App crash on iOS. Please help me!

Can you provide more details “App crashing”? If you want to dm me your project I can take a look.

I got this issue again:

App is crashing on start, console output is:

*** Terminating app due to uncaught exception 'FIRAnalyticsVersionMismatch', reason: 'Google Analytics for Firebase version (60202000) does not match with Google App Measurement (60803000) version. Please update.'

(Using Firebase Analytics and AdMob Plugin).

This problem might arise anytime the Firebase or AdMob plugin gets updated. Isn’t there a way to make the versions match automatic?

Best regards!

Hi,

I have been struggling with the same problem a couple of times. I managed to update the downloaded plugin versions in such a way that at the moment my game (development version) has no version conflicts and has Firebase Analytics and AdMob plugins running. I did unpack the plugin tars, replaced the conflicting files with compatible ones and repacked the files again. And the game runs and works both on iOS and Android.

I wrote a rather long article about this. Hopefully it helps and if you notice missing / unclear steps I can try to clarify. The article:
https://cleanseagame.docommit.com/blog/blog_solar2d_admob_notifications_firebase_plugins_on_ios.html

I am getting the below error when trying to build for iOS:

Undefined symbols for architecture arm64:\n “OBJC_CLASS$_GULKeychainUtils”, referenced from:\n objc-class-ref in FirebaseInstallations(FIRInstallationsIIDTokenStore.o)\n “OBJC_CLASS$_GULKeychainStorage”, referenced from:\n objc-class-ref in FirebaseInstallations(FIRInstallationsIDController.o)

@Scott_Harrison, it seems to be related to FirebaseAnalytics and Notifications.v2 plugins being used together.

Looking into this

2 Likes

@bamazy it looks like the notifications v2 just had firebase separated from it so the plugin should now build. Idk if the notification v2 firebase will build, will have to run tests

Plugin fails to build. Logged a bug report through the marketplace and thought I would put one up here. Build fails with duplicate class errors. removing firebaseAnalytics plugin makes build work again.

10:01:21.659 Execution failed for task ‘:App:checkReleaseDuplicateClasses’.
10:01:21.659 > 1 exception was raised by workers:
10:01:21.659 java.lang.RuntimeException: Duplicate class com.google.android.gms.internal.measurement.zzbt found in modules play-services-measurement-17.4.4-runtime.jar (com.google.android.gms:play-services-measurement:17.4.4) and play-services-measurement-sdk-api-17.5.0-runtime.jar (com.google.android.gms:play-services-measurement-sdk-api:17.5.0)
10:01:21.659 Duplicate class com.google.android.gms.internal.measurement.zzbu found in modules play-services-measurement-17.4.4-runtime.jar (com.google.android.gms:play-services-measurement:17.4.4) and play-services-measurement-sdk-api-17.5.0-runtime.jar (com.google.android.gms:play-services-measurement-sdk-api:17.5.0)
10:01:21.659 Duplicate class com.google.android.gms.internal.measurement.zzfw found in modules play-services-measurement-base-17.5.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.5.0) and play-services-measurement-impl-17.4.4-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.4)
10:01:21.659 Duplicate class com.google.android.gms.internal.measurement.zzfy found in modules play-services-measurement-base-17.5.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.5.0) and play-services-measurement-impl-17.4.4-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.4)
10:01:21.659 Duplicate class com.google.android.gms.internal.measurement.zzfz found in modules play-services-measurement-base-17.5.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.5.0) and play-services-measurement-impl-17.4.4-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.4)
10:01:21.659 Duplicate class com.google.android.gms.internal.measurement.zzga found in modules play-services-measurement-base-17.5.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.5.0) and play-services-measurement-impl-17.4.4-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.4)
10:01:21.659 Duplicate class com.google.android.gms.internal.measurement.zzgb found in modules play-services-measurement-base-17.5.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.5.0) and play-services-measurement-impl-17.4.4-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.4)
10:01:21.659 Duplicate class com.google.android.gms.measurement.internal.zzgz found in modules play-services-measurement-base-17.5.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.5.0) and play-services-measurement-impl-17.4.4-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.4)
10:01:21.659 Duplicate class com.google.android.gms.measurement.internal.zzik found in modules play-services-measurement-base-17.5.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.5.0) and play-services-measurement-impl-17.4.4-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.4)
10:01:21.659
10:01:21.659 Go to the documentation to learn how to Fix dependency resolution errors.
10:01:21.659
10:01:21.659

I’ve just discovered the problem - the marketplace ID was not in the build.settings - strange this never caused an issue previously, but it has now. Putting it in fixed my problems and I am able to build fine now.

Probably because the one without the Id is using the old repo with the old plugins and the one with the Id is pulling from the updated plugins from Scott’s H marketplace.

1 Like

Does someone else have the issue when building for a device? (Using Build 3639):

Undefined symbols for architecture armv7:
"_APMConsentSettings3P", referenced from: +[FIRAnalytics setConsent:] in FirebaseAnalytics(FIRAnalytics.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@Scott_Harrison, I am getting crash again when enabling FirebaseAnalytics on iOS. It gives “-[FBLPromise HTTPBody]: unrecognized selector sent to instance 0x2800018f0” as a reason. I googled this error and it seems it’s related to Firebase. When I disable FirebaseAnalytics the app works normally.

P.S. By “disabling” I mean in the code not requiring the plugin and initializing it. The lines to include the plugin still exist in the build.settings file.

Below is the error I get from GameAnalytics logs:

Blockquote PComp version 2021.3.291125 build (null)\nUncaught Exception\nException Name: NSInvalidArgumentException\nException Reason: -[FBLPromise firebaseInstallationID]: unrecognized selector sent to instance 0x282460930\nStack trace:\n 0 - 0 CoreFoundation 0x00000001836999d8 F3021642-E3C0-33F8-9911-DD303A6056D0 + 1157592\n 1 - 1 libobjc.A.dylib 0x0000000197a1fb54 objc_exception_throw + 56\n 2 - 2 CoreFoundation 0x00000001835a9bbc F3021642-E3C0-33F8-9911-DD303A6056D0 + 175036\n 3 - 3 CoreFoundation 0x000000018369c01c F3021642-E3C0-33F8-9911-DD303A6056D0 + 1167388\n 4 - 4 CoreFoundation 0x000000018369df8c _CF_forwarding_prep_0 + 92\n 5 - 5 YolNisanlariCL 0x0000000100f6ebcc FIRRealCurrentDateProvider + 3288\n 6 - 6 YolNisanlariCL 0x0000000101020bf4 FBLWaitForPromisesWithTimeout + 17744\n 7 - 7 libdispatch.dylib 0x00000001832d1298 AF27E74C-BE4A-3364-BB27-AED9916CE02D + 393880\n 8 - 8 libdispatch.dylib 0x00000001832d2280 AF27E74C-BE4A-3364-BB27-AED9916CE02D + 397952\n 9 - 9 libdispatch.dylib 0x00000001832810ac AF27E74C-BE4A-3364-BB27-AED9916CE02D + 65708\n 10 - 10 CoreFoundation 0x00000001836195e0 F3021642-E3C0-33F8-9911-DD303A6056D0 + 632288\n 11 - 11 CoreFoundation 0x0000000183613a88 F3021642-E3C0-33F8-9911-DD303A6056D0 + 608904\n 12 - 12 CoreFoundation 0x0000000183612ba0 CFRunLoopRunSpecific + 572\n 13 - 13 GraphicsServices 0x000000019a37b598 GSEventRunModal + 160\n 14 - 14 UIKitCore 0x0000000185f042f4 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 11723508\n 15 - 15 UIKitCore 0x0000000185f09874 UIApplicationMain + 164\n 16 - 16 YolNisanlariCL 0x000000010163bac8 APDEvent_EventType_IsValidValue + 13092\n 17 - 17 libdyld.dylib 0x00000001832f1568 0B475C78-3C12-3121-B7F8-2B95B83DAF44 + 5480\n

I have same problem with admob plugin and Firebase Analytics plugin.
Do you find solution?

@Scott_Harrison, just thought I’d like you know that when I discovered and reported the conflict between Firebase and notifications v2 more than a year ago, I had no choice but to remove your Firebase plugins, plural. I’ll be following this thread because I think it’s a worthwhile plugin for the future, once its device conflicts and issues with other plugins are resolved.

I will look into this sometime this week

@Scott_Harrison, I tried to build Firebase Database and FirebaseAnalytics together but I got conflict error.

I get the same error, what should I do?