Firebase Analytics crashed on ios first run

Hi,
My apps has been crashing on the first run consistently. After firebase is enabled this is the log that follows
 

[Device] \<FIRAnalytics/INFO\> Firebase Analytics enabled [Device] +[NSData gtm\_dataByGzippingData:]: unrecognized selector sent to class 0x3c168efc [Device] \*\*\* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData gtm\_dataByGzippingData:]: unrecognized selector sent to class 0x3c168efc' [Device] \*\*\* First throw call stack: [Device] (0x257d791b 0x24f72e17 0x257dd1d1 0x257daee1 0x25706238 0x3d5877 0x3e7573 0x3cc09b 0x3e5ac1 0x3e0eb1 0x3e8fa7 0x3e89c9 0x25345823 0x25352423 0x25351a61 0x2535415d 0x25353fcd 0x25509b29 0x25509718)

I’ve added the plist file and also added FirebaseAppDelegateProxyEnabled=false to the build.settings.

After a restart, anytime I tried to logevent I’ll get these logs
 

[Device] +[NSData gtm\_dataByGzippingData:]: unrecognized selector sent to class 0x3c168efc [Device] \<FIRAnalytics/ERROR\> Exception on worker queue. Block ID=FIRAMeasurement:976. Exception: NSInvalidArgumentException: +[NSData gtm\_dataByGzippingData:]: unrecognized selector sent to class 0x3c168efc

Cheers

I cannot reproduce please upload a sample which clearly shows the issue. When I say sample, I mean zip file which I can build immediately. 

Sorry for the late reply.

https://www.dropbox.com/s/ult4z17mokuotbh/Firebase%20Test.zip

Forgot to mention, the build is from corona 2017.3079

Cheers

I ran this with the latest version and no luck reproducing. I used Corona SDK 3086. You may try this.

timer.performWithDelay( 100, function ( e ) analyticHelper.init() end )

As an important note, I removed the AdMob stuff. I don’t have the AdMob plugin. I don’t want to spend 200$ to fix a bug in a free plugin. You may want to launch a bug report with Corona.

Alrite, noted. Thanks for the reply and suggestion.

Hi,

I have the same issue as well.

Just after adding the Firebase Analytics plugin to my project, the app crashes very often a few seconds after the start. I’m using Corona SDK 2017.3086.

I also get the same exception error message:

Juni 17 09:16:03.181 [Device] +[NSData gtm\_dataByGzippingData:]: unrecognized selector sent to class 0x1ac713b98 Juni 17 09:16:03.196 [Device] \*\*\* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData gtm\_dataByGzippingData:]: unrecognized selector sent to class 0x1ac713b98'

From Google I found that this error is happening also with the Swift version of Firebase Analytics when you are missing the “-ObjC” Linker Flag. However, with Corona SDK I’m not able to test if that would fix it.

Best regards,

Björn

Objc flag is added already. I am sorry about this issue but my hands are tied. I’ll see maybe I can to someone at corona and see if i can get acces to admob for a day so I can fix this. I need to be able reproduce, in order to fix issue

Hi,

I just commented all references to AdMob and removed the Plugin from the build.settings file (I was using the paid plugin).

The issue is still happening.

However, of course I don’t know if Corona really got rid of AdMob during the build process, or if there are still some temporary files or things like that which are still AdMob related and lead to that bug.

Best regards,

Björn

Can you post a sample project with AdMob. in which shows the problem? 

Hi Scott,

the problem is independent from AdMob.

Just create a new “Blank” Corona Project, and do the following:

  1. Add the “GoogleService-Info.plist” file to the project directory

  2. Add the plugin:

    plugins = { [“plugin.firebaseAnalytics”] = { publisherId = “tech.scotth”, }, },

  3. Just add this to main.lua:

    local firebaseAnalytics = require “plugin.firebaseAnalytics” firebaseAnalytics.init ()

This is enough to reproduce the bug for me. Be sure to always delete the app from the device before installing, because the crash does always happen when the app is run for the first time on the device. (On later runs the crash only happens occasionally).

After starting the app wait for a few seconds and the app will crash.

By the way, I’m using Corona SDK Version 2017.3068, iOS SDK 10.3 and running the app on an iPhone 6s using iOS 10.3.2.

Best regards,

Björn

This should be patched.

I can confirm this.

Thank you Scott!

Hello! Not work firebaseAnalytics.init();

Crash application on start. iPhone 5s iOS 11.0.2, Corona SDK 2017.3160, xCode 9 iOS SDK 11

Have you tried putting a timer around firebase.init

Thank you! All worked  :slight_smile:

timer.performWithDelay(1000, function() firebaseAnalytics.init(); end);