Skip to content

App crashes after manually updating GoogleTagManager to 7.1.1 #2059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
VValiente opened this issue Nov 8, 2018 · 12 comments
Closed

App crashes after manually updating GoogleTagManager to 7.1.1 #2059

VValiente opened this issue Nov 8, 2018 · 12 comments

Comments

@VValiente
Copy link

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

  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request make sure the issue title starts with "FR:".
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 10.0
  • Firebase SDK version: 5.12.0
  • Firebase Component: GoogleTagManager
  • Component version: 7.1.1

[REQUIRED] Step 3: Describe the problem

NOTE: We use cocoapods to get the GoogleTagManager frameworks via a separate project, and then manually integrate the static frameworks into our Swift Project.


With GoogleTagManager(6.0.0), our app is working fine, same for the GTM features. Now that we are planning to implement FirebaseMessaging, we decided to update GTM first so we can also use the latest version of FirebaseMessaging.

After updating the frameworks, at launch, the app crashes immediately after this console line(.json filename is masked here):

GoogleTagManager info: Attempting to load saved version of container GTM-XXXXXX

And below is the stack trace:
enter image description here

Steps to reproduce:

  • Run the app
  • Crash

Relevant Code:

Our pod file looks like this:

target 'SampleProject'
platform :ios, '10.0'
pod 'GoogleTagManager'

Here are the versions after the update:

Using FirebaseAnalytics (5.3.0)
Using FirebaseCore (5.1.7)
Using FirebaseInstanceID (3.3.0)
Using GoogleAnalytics (3.17.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleSymbolUtilities (1.1.2)
Using GoogleTagManager (7.1.1)
Using GoogleUtilities (5.3.4)
Using GoogleUtilitiesLegacy (1.3.2)
Using nanopb (0.3.901)

However, some of the dependency frameworks are now just folders with just .h and .m files instead of .framework. Adding use_frameworks! didn't help.

So we turned to the framework SDK zip and grabbed the following .frameworks version instead(the version matched the ones from the cocoapods):

FirebaseCore.framework
GoogleUtilities.framework
nanopb.framework

And used the zip's Firebase.h and module.modulemap.

After setting up LIBRARY_SEARCH_PATHS to point correctly to libGoogleAnalytics.a, and replacing import FirebaseAnalytics with import Firebase, we were able to build the project.

I already checked, TAGRuntime.js.dat is added to Build Phases>Copy Bundle Resources

What am I missing?

@paulb777
Copy link
Member

paulb777 commented Nov 8, 2018

I suspect that the GoogleAnalytics 3.x pod is not compatible with the recent GoogleTagManager version.

I need to confirm, but It may not be possible to use the old GoogleAnalytics along with the recent FirebaseAnalytics and GoogleTagManager.

@VValiente
Copy link
Author

VValiente commented Nov 8, 2018

The GoogleAnalytics is from the cocoapods installation though.

Below are all static frameworks we added for GTM. We just took them out of their folders.
screenshot 2018-11-08 at 16 37 05

@paulb777
Copy link
Member

paulb777 commented Nov 8, 2018

Presumably the Podfile is asking for GoogleAnalytics to be installed

@VValiente
Copy link
Author

VValiente commented Nov 8, 2018

I also tried installing pod from scratch, and it still used that version for GoogleTagManager (7.1.1). I was also wondering why the GoogleAnalytics' version didn't change, but assumed that was intentional. With GoogleTagManager (6.0.0), it's the same GoogleAnalytics (3.17.0) version number.

Here is the the contents of the Podfile.lock from a fresh install:

PODS:
  - FirebaseAnalytics (5.3.0):
    - FirebaseCore (~> 5.1)
    - FirebaseInstanceID (~> 3.3)
    - GoogleAppMeasurement (~> 5.3)
    - GoogleUtilities/AppDelegateSwizzler (~> 5.2)
    - GoogleUtilities/MethodSwizzler (~> 5.2)
    - GoogleUtilities/Network (~> 5.2)
    - "GoogleUtilities/NSData+zlib (~> 5.2)"
    - nanopb (~> 0.3)
  - FirebaseCore (5.1.7):
    - GoogleUtilities/Logger (~> 5.2)
  - FirebaseInstanceID (3.3.0):
    - FirebaseCore (~> 5.1)
    - GoogleUtilities/Environment (~> 5.3)
    - GoogleUtilities/UserDefaults (~> 5.3)
  - GoogleAnalytics (3.17.0)
  - GoogleAppMeasurement (5.3.0):
    - GoogleUtilities/AppDelegateSwizzler (~> 5.2)
    - GoogleUtilities/MethodSwizzler (~> 5.2)
    - GoogleUtilities/Network (~> 5.2)
    - "GoogleUtilities/NSData+zlib (~> 5.2)"
    - nanopb (~> 0.3)
  - GoogleSymbolUtilities (1.1.2)
  - GoogleTagManager (7.1.1):
    - FirebaseAnalytics (~> 5.1)
    - GoogleAnalytics (~> 3.17)
    - GoogleUtilitiesLegacy (~> 1.3)
  - GoogleUtilities/AppDelegateSwizzler (5.3.4):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (5.3.4)
  - GoogleUtilities/Logger (5.3.4):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (5.3.4):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (5.3.4):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (5.3.4)"
  - GoogleUtilities/Reachability (5.3.4):
    - GoogleUtilities/Logger
  - GoogleUtilities/UserDefaults (5.3.4):
    - GoogleUtilities/Logger
  - GoogleUtilitiesLegacy (1.3.2):
    - GoogleSymbolUtilities (~> 1.1)
  - nanopb (0.3.901):
    - nanopb/decode (= 0.3.901)
    - nanopb/encode (= 0.3.901)
  - nanopb/decode (0.3.901)
  - nanopb/encode (0.3.901)

DEPENDENCIES:
  - GoogleTagManager

SPEC REPOS:
  https://github.com/cocoapods/specs.git:
    - FirebaseAnalytics
    - FirebaseCore
    - FirebaseInstanceID
    - GoogleAnalytics
    - GoogleAppMeasurement
    - GoogleSymbolUtilities
    - GoogleTagManager
    - GoogleUtilities
    - GoogleUtilitiesLegacy
    - nanopb

SPEC CHECKSUMS:
  FirebaseAnalytics: 63202d2665de4e6adcbdce189135255d8b5962ba
  FirebaseCore: 027d350adc039aa5483357c6f56556f117c5170e
  FirebaseInstanceID: e2fa4cb35ef5558c200f7f0ad8a53e212215f93e
  GoogleAnalytics: f42cc53a87a51fe94334821868d9c8481ff47a7b
  GoogleAppMeasurement: 5029d78f2b438bd30ffb44e6c558b57c21622727
  GoogleSymbolUtilities: 631ee17048aa5e9ab133470d768ea997a5ef9b96
  GoogleTagManager: f266d4573d63315faf2c6e353065c289ba4d2372
  GoogleUtilities: abb092d2c12e817fa3e0e7b274987dd72fb86ec3
  GoogleUtilitiesLegacy: 5501bedec1646bd284286eb5fc9453f7e23a12f4
  nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48

PODFILE CHECKSUM: eddafe3c597776720ff15b2a424bad82ac33f65e

COCOAPODS: 1.5.3

@paulb777
Copy link
Member

paulb777 commented Nov 8, 2018

Oh I see - GoogleAnalytics 3.17.0 is a dependency of GoogleTagManager. See https://cocoapods.org/pods/GoogleTagManager My hypothesis above was wrong. Something else is going on. I'll report it to the GoogleTagManager team.

@VValiente
Copy link
Author

Yes it is. :) And thank you for the quick reply! I already wasted 2 days for this and was desperate for help. 😅

@paulb777
Copy link
Member

paulb777 commented Nov 8, 2018

Tracked internally at b/119253176

@VValiente
Copy link
Author

@paulb777 we just noticed a big crash group related to this: #502. You suggested in that thread to update to Firebase 4.8.0.

Since we really need to make FirebaseMessaging working soon, and fix this big crash, could you please tell us which versions we need to install to use the following components:

  • GoogleTagManager
  • FirebaseMessaging

I'm not sure which versions of GTM and Messaging are compatible with Firebase 4.8.0.

Thanks in advance!

@VValiente
Copy link
Author

Updating our pods to:

target 'SampleProject'
platform :ios, '10.0'
pod 'Firebase', '4.8.0'
pod 'GoogleTagManager'
pod 'Firebase/Core'
pod 'Firebase/Messaging'

We currently have the following versions:

PODS:
  - Firebase (4.8.0):
    - Firebase/Core (= 4.8.0)
  - Firebase/Core (4.8.0):
    - FirebaseAnalytics (= 4.0.5)
    - FirebaseCore (= 4.0.13)
  - Firebase/Messaging (4.8.0):
    - Firebase/Core
    - FirebaseMessaging (= 2.0.8)
  - FirebaseAnalytics (4.0.5):
    - FirebaseCore (~> 4.0)
    - FirebaseInstanceID (~> 2.0)
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
    - nanopb (~> 0.3)
  - FirebaseCore (4.0.13):
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
  - FirebaseInstanceID (2.0.10):
    - FirebaseCore (~> 4.0)
  - FirebaseMessaging (2.0.8):
    - FirebaseAnalytics (~> 4.0)
    - FirebaseCore (~> 4.0)
    - FirebaseInstanceID (~> 2.0)
    - GoogleToolboxForMac/Logger (~> 2.1)
    - Protobuf (~> 3.1)
  - GoogleAnalytics (3.17.0)
  - GoogleSymbolUtilities (1.1.2)
  - GoogleTagManager (6.0.0):
    - FirebaseAnalytics (~> 4.0)
    - GoogleAnalytics (~> 3.17)
    - GoogleUtilities (~> 1.3)
  - GoogleToolboxForMac/Defines (2.1.4)
  - GoogleToolboxForMac/Logger (2.1.4):
    - GoogleToolboxForMac/Defines (= 2.1.4)
  - "GoogleToolboxForMac/NSData+zlib (2.1.4)":
    - GoogleToolboxForMac/Defines (= 2.1.4)
  - GoogleUtilities (1.3.2):
    - GoogleSymbolUtilities (~> 1.1)
  - nanopb (0.3.901):
    - nanopb/decode (= 0.3.901)
    - nanopb/encode (= 0.3.901)
  - nanopb/decode (0.3.901)
  - nanopb/encode (0.3.901)
  - Protobuf (3.6.1)

DEPENDENCIES:
  - Firebase (= 4.8.0)
  - Firebase/Core
  - Firebase/Messaging
  - GoogleTagManager

SPEC REPOS:
  https://github.com/cocoapods/specs.git:
    - Firebase
    - FirebaseAnalytics
    - FirebaseCore
    - FirebaseInstanceID
    - FirebaseMessaging
    - GoogleAnalytics
    - GoogleSymbolUtilities
    - GoogleTagManager
    - GoogleToolboxForMac
    - GoogleUtilities
    - nanopb
    - Protobuf

SPEC CHECKSUMS:
  Firebase: 710decbbc6d9d48530e9a5dba3209740c3532e05
  FirebaseAnalytics: 5b02a63ead2c3f0259cfc7f15e053e440587ecf8
  FirebaseCore: 3c02ec652db3d03fdc8bc6d9154af3e20d64b6f5
  FirebaseInstanceID: 8d20d890d65c917f9f7d9950b6e10a760ad34321
  FirebaseMessaging: dfdcd307c2382290a1e297a81d0f18370f5b1bcd
  GoogleAnalytics: f42cc53a87a51fe94334821868d9c8481ff47a7b
  GoogleSymbolUtilities: 631ee17048aa5e9ab133470d768ea997a5ef9b96
  GoogleTagManager: 07acea48abe73aac17550b81bbf52a37db2d7dd6
  GoogleToolboxForMac: 91c824d21e85b31c2aae9bb011c5027c9b4e738f
  GoogleUtilities: 8bbc733218aad26306f9d4a253823986110e3358
  nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
  Protobuf: 1eb9700044745f00181c136ef21b8ff3ad5a0fd5

PODFILE CHECKSUM: 4533b577ef43229794b7b4f2f4babfb44313b504

COCOAPODS: 1.5.3

So far the project builds without any issue and there is no crash at start up. Still need to implement FirebaseMessaging though and test GTM if it still works. This isn't the best solution but we need to do something to fix the Firebase crash group and implement Messaging. Still hoping that the issue with the latest versions could be fixed. 👍

@timurbeg
Copy link

Hi guys, my apoligies for using this thread for solving my issue.

I'm facing similar issue though it happens after I decompile/compile the build via ixguard(code obfuscation) tool.
Without ixguard, build runs well - no issues.

My pods look as below:

platform :ios, '10.0'
workspace 'MyProject-ios'
pod 'GoogleTagManager'
pod 'GoogleAnalytics'
pod 'Firebase/Core'
pod 'Firebase/Database'

And I have following versions:

PODS:
  - Firebase/Core (5.15.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 5.4.0)
  - Firebase/CoreOnly (5.15.0):
    - FirebaseCore (= 5.1.10)
  - Firebase/Database (5.15.0):
    - Firebase/CoreOnly
    - FirebaseDatabase (= 5.0.4)
  - FirebaseAnalytics (5.4.0):
    - FirebaseCore (~> 5.1)
    - FirebaseInstanceID (~> 3.3)
    - GoogleAppMeasurement (= 5.4.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 5.2)
    - GoogleUtilities/MethodSwizzler (~> 5.2)
    - GoogleUtilities/Network (~> 5.2)
    - "GoogleUtilities/NSData+zlib (~> 5.2)"
    - nanopb (~> 0.3)
  - FirebaseAuthInterop (1.0.0)
  - FirebaseCore (5.1.10):
    - GoogleUtilities/Logger (~> 5.2)
  - FirebaseDatabase (5.0.4):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 5.1)
    - leveldb-library (~> 1.18)
  - FirebaseInstanceID (3.3.0):
    - FirebaseCore (~> 5.1)
    - GoogleUtilities/Environment (~> 5.3)
    - GoogleUtilities/UserDefaults (~> 5.3)
  - FLAnimatedImage (1.0.12)
  - GoogleAnalytics (3.17.0)
  - GoogleAppMeasurement (5.4.0):
    - GoogleUtilities/AppDelegateSwizzler (~> 5.2)
    - GoogleUtilities/MethodSwizzler (~> 5.2)
    - GoogleUtilities/Network (~> 5.2)
    - "GoogleUtilities/NSData+zlib (~> 5.2)"
    - nanopb (~> 0.3)
  - GoogleSymbolUtilities (1.1.2)
  - GoogleTagManager (7.1.1):
    - FirebaseAnalytics (~> 5.1)
    - GoogleAnalytics (~> 3.17)
    - GoogleUtilitiesLegacy (~> 1.3)
  - GoogleUtilities/AppDelegateSwizzler (5.3.6):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (5.3.6)
  - GoogleUtilities/Logger (5.3.6):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (5.3.6):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (5.3.6):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (5.3.6)"
  - GoogleUtilities/Reachability (5.3.6):
    - GoogleUtilities/Logger
  - GoogleUtilities/UserDefaults (5.3.6):
    - GoogleUtilities/Logger
  - GoogleUtilitiesLegacy (1.3.2):
    - GoogleSymbolUtilities (~> 1.1)

DEPENDENCIES:
  - Firebase/Core
  - Firebase/Database
  - GoogleAnalytics
  - GoogleTagManager

SPEC REPOS:
  https://github.com/cocoapods/specs.git:
    - Firebase
    - FirebaseAnalytics
    - FirebaseAuthInterop
    - FirebaseCore
    - FirebaseDatabase
    - FirebaseInstanceID
    - FLAnimatedImage
    - GoogleAnalytics
    - GoogleAppMeasurement
    - GoogleSymbolUtilities
    - GoogleTagManager
    - GoogleUtilities
    - GoogleUtilitiesLegacy

SPEC CHECKSUMS:
  Firebase: 8bb9268bff82374f2cbaaabb143e725743c316ae
  FirebaseAnalytics: c06f9d70577d79074214700a71fd5d39de5550fb
  FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc
  FirebaseCore: 35747502d9e8c6ee217385ad04446c7c2aaf9c5c
  FirebaseDatabase: 0621689f77528d62b47e1c06ca737c4c19275d1a
  FirebaseInstanceID: e2fa4cb35ef5558c200f7f0ad8a53e212215f93e
  FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
  GoogleAnalytics: f42cc53a87a51fe94334821868d9c8481ff47a7b
  GoogleAppMeasurement: 98b71f5e04142793729a5ef23e5b96651ff4b70f
  GoogleSymbolUtilities: 631ee17048aa5e9ab133470d768ea997a5ef9b96
  GoogleTagManager: f266d4573d63315faf2c6e353065c289ba4d2372
  GoogleUtilities: 95996bea7c7d9b8fb811b7507669a4a8762f80c7
  GoogleUtilitiesLegacy: 5501bedec1646bd284286eb5fc9453f7e23a12f4

PODFILE CHECKSUM: 152abb7c6e8106205cb3abd99cf1c31fc9970458

COCOAPODS: 1.5.3

I'm able to install my app and even I can finish onboarding flow for a new user.
But as soon as I login to my app - it crashes:

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  5

Application Specific Information:
abort() called

Filtered syslog:
None found

Last Exception Backtrace:
0   CoreFoundation                	0x184ad6d8c __exceptionPreprocess + 228
1   libobjc.A.dylib               	0x183c905ec objc_exception_throw + 55
2   CoreFoundation                	0x184ae3fd8 +[NSObject+ 1388504 (NSObject) doesNotRecognizeSelector:] + 139
3   CoreFoundation                	0x184adc5c8 ___forwarding___ + 1379
4   CoreFoundation                	0x1849c241c _CF_forwarding_prep_0 + 91
5   NuMi-Stage                    	0x1002f8768 -[GSDK_GTMABRecord setValue:forProperty:] + 379
6   NuMi-Stage                    	0x100307ac8 -[TAGJSExportedInstructions asJsValueInContext:] + 291
7   NuMi-Stage                    	0x100306958 -[TAGRuntime initWithContainerId:resource:hitStore:dispatchScheduler:] + 627
8   NuMi-Stage                    	0x100315534 __55-[TAGContainer handleLoadOfContainerData:errorMessage:]_block_invoke + 355
9   libdispatch.dylib             	0x1843c8aa0 _dispatch_call_block_and_release + 23
10  libdispatch.dylib             	0x1843c8a60 _dispatch_client_callout + 15
11  libdispatch.dylib             	0x1843d29b4 _dispatch_queue_serial_drain$VARIANT$mp + 607
12  libdispatch.dylib             	0x1843d32fc _dispatch_queue_invoke$VARIANT$mp + 335
13  libdispatch.dylib             	0x1843d3cc8 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 339
14  libdispatch.dylib             	0x1843dc098 _dispatch_workloop_worker_thread$VARIANT$mp + 667
15  libsystem_pthread.dylib       	0x1846fbe70 _pthread_wqthread + 859
16  libsystem_pthread.dylib       	0x1846fbb08 start_wqthread + 3

If you see any issues with my pods or have some useful info for solution of this issue - please let me know.

@paulb777
Copy link
Member

paulb777 commented Feb 6, 2019

@VValiente We haven't been able to reproduce the issue, so likely need a reproducible example to make progress.

@timurbeg Sounds like there might be an issue with ixguard. I'm not sure we'll be able to help.

@paulb777
Copy link
Member

Closing for now. Will reopen with additional reproducible data.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants