firebase-ios-sdk: Integration with GoogleTagManager will crash the app at startup

[READ] Step 1: Are you in the right place?

I think yes because it is similar to this issue: #2059

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 10.3
  • Firebase SDK version: 6.8.1
  • Firebase Component: Core, Analytics
  • Component version: unknown because i picked FirebaseCore.framework and FirebaseAnalytics.framework from this 6.8.1 bundle

[REQUIRED] Step 3: Describe the problem

I’m trying to create a Titanium Module that include Google Tag Manager using Firebase Analytics as a datalayer. I’ve followed this official guide and I’m trying to use GoogleTagManager 7.1.2.

The module builds fine and the app will run fine until I call [FIRApp configure] method and then the app will crash immediately.

Steps to reproduce:

Here are all the included frameworks inside the Titanium Module iOS project that I got from Firebase/Analytics 6.8.1 bundle folder:

image

Running the app and opening Console app on my mac I can see these messages

default	16:34:32.366979 +0200	tests	GoogleTagManager info: Loading container: GTM-T3DH88D
default	16:34:32.406538 +0200	tests	GoogleTagManager info: Attempting to load saved version of container GTM-T3DH88D

so the library correctly tries to load my container.

Opening the .crash file from DiagnosticReports I can see this output:

Crashed Thread:        4  Dispatch queue: TagManagerContainerQueue

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Note:        EXC_CORPSE_NOTIFY

where the crashed thread is

Thread 4 Crashed:: Dispatch queue: TagManagerContainerQueue
0   com.apple.JavaScriptCore      	0x000000010739e679 WTF::String::isolatedCopy() const & + 9
1   com.apple.JavaScriptCore      	0x000000010752e0b2 OpaqueJSString::string() const + 18
2   com.apple.JavaScriptCore      	0x0000000107515910 JSEvaluateScript + 160
3   com.apple.JavaScriptCore      	0x00000001074f2b02 -[JSContext evaluateScript:withSourceURL:] + 194
4   comehome                      	0x0000000106f17815 -[TAGRuntime initWithContainerId:resource:hitStore:dispatchScheduler:] + 450
5   comehome                      	0x0000000106f0dae8 __55-[TAGContainer handleLoadOfContainerData:errorMessage:]_block_invoke + 274
6   libdispatch.dylib             	0x00000001101e6ccf _dispatch_call_block_and_release + 12
7   libdispatch.dylib             	0x00000001101e7d02 _dispatch_client_callout + 8
8   libdispatch.dylib             	0x00000001101ee720 _dispatch_lane_serial_drain + 705
9   libdispatch.dylib             	0x00000001101ef261 _dispatch_lane_invoke + 398
10  libdispatch.dylib             	0x00000001101f7fcb _dispatch_workloop_worker_thread + 645
11  libsystem_pthread.dylib       	0x00000001105c9611 _pthread_wqthread + 421
12  libsystem_pthread.dylib       	0x00000001105c93fd start_wqthread + 13

Relevant Code:

The only code that I run at startup is:

[FIRApp configure];
DebugLog(@"App instance id: %@", [FIRAnalytics appInstanceID]);

and I can correctly see this log message:

[DEBUG] App instance id: 8C7CD2DA60C24EEBA6EF2304353895C8

I attach here the entire crash report file.

tests_2019-09-25-163437_MacBook-Pro-di-Andrea-2.txt

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@AndreaVitale it’s one of products/targets of tag manager. I’m using cocoapods rome and since it’s not created automatically i created and added it manually image