iOS Google跟踪代码管理器在启动时因'NSParseErrorException'而崩溃,原因是:'上次代码:116应为124'

时间:2015-06-11 21:38:07

标签: ios xcode google-analytics crash google-tag-manager

我们的谷歌分析与Google跟踪代码管理器在我们的其他3个应用程序中运行,但出于某种原因,这个最新的应用程序在尝试打开容器时崩溃。

以下是相关代码行(类似于GTM's guidelines):

        NSTimeInterval timeout = 0.1;
        [TAGContainerOpener openContainerWithId:containerName
                                     tagManager:_tagManager
                                       openType:kTAGOpenTypePreferNonDefault
                                        timeout:&timeout
                                       notifier:self];

抛出的错误:

Terminating app due to uncaught exception 'NSParseErrorException', 
reason: 'Last tag: 116 should be 124'

堆栈追踪:

*** First throw call stack:
(
    0   CoreFoundation                      0x0000000104dffa75 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000104716bb7 objc_exception_throw + 45
    2   CoreFoundation                      0x0000000104dff9ad +[NSException raise:format:] + 205
    3   MyApp                             0x0000000102831ce6 -[TAGPBCodedInputStream readUnknownGroup:builder:] + 152
    4   MyApp                             0x0000000102844904 -[TAGPBUnknownFieldSet mergeFieldFrom:input:] + 283
    5   MyApp                             0x000000010283ceb1 -[TAGPBGeneratedMessage parseUnknownField:extensionRegistry:tag:] + 203
    6   MyApp                             0x000000010283cfc8 -[TAGPBGeneratedMessage mergeFromCodedInputStream:extensionRegistry:] + 264
    7   MyApp                             0x000000010283cb35 -[TAGPBGeneratedMessage mergeFromData:extensionRegistry:] + 88
    8   MyApp                             0x000000010283cc1e +[TAGPBGeneratedMessage parseFromData:extensionRegistry:] + 82
    9   MyApp                             0x0000000102852da7 -[TAGResourceStorageImpl loadResourceFromContainerFile:] + 352
    10  MyApp                             0x000000010284d245 -[TAGContainer createInitialContainer] + 89
    11  MyApp                             0x000000010284afd3 -[TAGContainer initWithId:tagManager:resourceStorage:] + 399
    12  MyApp                             0x000000010284b098 -[TAGContainer initWithId:tagManager:] + 112
    13  MyApp                             0x000000010284ffe5 -[TAGManager containerById:] + 64
    14  MyApp                             0x000000010284f618 -[TAGManager openContainerById:callback:] + 258
    15  MyApp                             0x000000010284e9d3 -[TAGContainerOpener openWithRefreshType:] + 850
    16  MyApp                             0x000000010284e5c5 +[TAGContainerOpener openContainerWithId:tagManager:openType:timeout:notifier:] + 155
    17  MyApp                             0x0000000102812588 -[AnalyticsManager initWithTrackingId:containerName:] + 776
    18  MyApp                             0x00000001027b5afe -[TIXAppDelegate setupAnalytics] + 94

到目前为止,我似乎无法在网上找到任何信息。到目前为止,我唯一看到的是在GA's Release notes中提到他们已经弃用了openContainerWithId,但是他们当前的指南没有说明这个或者使用什么。

这是容器文件内容:

{
    "exportFormatVersion": 1.3,
    "exportTime": "2015-06-23 16:11:59",
    "containerVersion": {
        "accountId": "197720",
        "containerId": "1300316",
        "containerVersionId": "0",
        "deleted": false,
        "container": {
            "accountId": "197720",
            "containerId": "1300316",
            "name": "App",
            "publicId": "GTM-MYCONTAINER",
            "timeZoneCountryId": "US",
            "timeZoneId": "America/Los_Angeles",
            "notes": "",
            "usageContext": [
                "IOS"
            ],
            "fingerprint": "1434997566330",
            "enabledBuiltInVariable": [
                "EVENT",
                "APP_ID",
                "APP_NAME",
                "APP_VERSION_CODE",
                "APP_VERSION_NAME"
            ]
        },
        "fingerprint": "0",
        "variable": [
            {
                "accountId": "197720",
                "containerId": "1300316",
                "variableId": "1",
                "name": "UA Number",
                "type": "c",
                "parameter": [
                    {
                        "type": "TEMPLATE",
                        "key": "value",
                        "value": "UA-TrackingNumber"
                    }
                ],
                "fingerprint": "0"
            },
            {
                "accountId": "197720",
                "containerId": "1300316",
                "variableId": "3",
                "name": "screen-from",
                "type": "v",
                "parameter": [
                    {
                        "type": "TEMPLATE",
                        "key": "name",
                        "value": "screen-from"
                    }
                ],
                "fingerprint": "0"
            },
            {
                "accountId": "197720",
                "containerId": "1300316",
                "variableId": "2",
                "name": "screen-name",
                "type": "v",
                "parameter": [
                    {
                        "type": "TEMPLATE",
                        "key": "name",
                        "value": "screen-name"
                    }
                ],
                "fingerprint": "0"
            },
            {
                "accountId": "197720",
                "containerId": "1300316",
                "variableId": "4",
                "name": "view-name",
                "type": "v",
                "parameter": [
                    {
                        "type": "TEMPLATE",
                        "key": "name",
                        "value": "view-name"
                    }
                ],
                "fingerprint": "0"
            }
        ]
    }
}

任何帮助表示感谢。

1 个答案:

答案 0 :(得分:1)

事实证明,如果在Google代码管理器的服务器端没有创建实际标记,则会发生此问题。

我们的分析人员最终做了以下事情: 1.在服务器上创建所需的标签 2.生成我们在代码中更新的新容器文件

然后崩溃消失了,一切正常。