locked
iOS 9 - google analytics component crash RRS feed

  • Question

  • User63179 posted

    Using:

    Xamarin.iOS Version: 8.10.3.2 (Business Edition)

    Xamarin Studio Version 5.9.4 (build 5)

    When trying to initialise Google Tag Manager, the app crashes on iOS 9 beta - 4. In particular, it fails on line:

    TAGContainerOpener.OpenContainer(code, tagManager, TAGOpenType.PreferFresh, 2, this);)

    Try / Catch exception is not caught, as this seems like a catastrophic failure. However, last piece of info from iOS logs show some info:

    Jul 28 18:03:45 iemcinipm2 symptomsd[94] : _51-[FlowAnalyticsEngine _applicationStateMonitorInit]block_invoke Can't convert appState from dictionary { BKSApplicationStateExtensionKey = 0; SBApplicationStateDisplayIDKey = "xy.z.abc"; SBApplicationStateKey = 0; SBApplicationStateProcessIDKey = 246; }

    Anyone have an idea - is this a component issue?

    Thanks

    Tuesday, July 28, 2015 6:27 AM

Answers

  • User101663 posted

    I have experienced this same issue, however we have found a workaround for iOS 9.

    Changing the timeout argument in the OpenContainer call to be null instead of a double resolves this issue (the 2 in your example).

    I am not yet sure why this is, though I have noticed that the call bridge goes through the following function:

    GoogleAnalyticsiOSTAGContainerOpener_OpenContainerstringGoogleAnalyticsiOSTAGManagerGoogleAnalyticsiOSTAGOpenTypeFoundationNSNumberGoogleAnalyticsiOS_ITAGContainerOpenerNotifier

    Note that this has a NSNumber as a parameter, while the actual Objective-C implementation of OpenContainer expects to be passed a pointer to a NSTimeInterval aka a double. If this was incorrectly bridged then the native code might be crashing when it attempts to access the timeout value.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, July 30, 2015 12:27 AM

All replies

  • User101663 posted

    I have experienced this same issue, however we have found a workaround for iOS 9.

    Changing the timeout argument in the OpenContainer call to be null instead of a double resolves this issue (the 2 in your example).

    I am not yet sure why this is, though I have noticed that the call bridge goes through the following function:

    GoogleAnalyticsiOSTAGContainerOpener_OpenContainerstringGoogleAnalyticsiOSTAGManagerGoogleAnalyticsiOSTAGOpenTypeFoundationNSNumberGoogleAnalyticsiOS_ITAGContainerOpenerNotifier

    Note that this has a NSNumber as a parameter, while the actual Objective-C implementation of OpenContainer expects to be passed a pointer to a NSTimeInterval aka a double. If this was incorrectly bridged then the native code might be crashing when it attempts to access the timeout value.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, July 30, 2015 12:27 AM
  • User60372 posted

    Like @MelbyRuarus said, a workaround of this is using null or numbers with decimals (e.g 0.1, 2.1) in the timeout parameter. Using numbers without decimals (e.g 1, 2, 2.0, 4.0) will terminate the app.

    The reason of why a NSNumber was used is because the method was expecting a pointer to a double and a NSNumber is a pointer to any number type (int, float, double) etc. But we will check if something changed from iOS 8 to iOS 9.

    Thursday, July 30, 2015 1:24 AM