iOS   发布时间:2022-05-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了iOS Google跟踪代码管理器在启动时因’NSParseErrorException’而崩溃,原因:’上次标记:116应为124′大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我们在其他3个iOS应用中运行带有Google跟踪代码管理器的谷歌分析,但出于某种原因,这个最新的应用程序在尝试打开容器时崩溃. 这是有问题的代码行(类似于GTM’s guidelines): NSTimeInterval timeout = 0.1; [TAGContainerOpener openContainerWithId:containerName
@H_674_10@
我们在其他3个iOS应用中运行带有Google跟踪代码管理器的谷歌分析,但出于某种原因,这个最新的应用程序在尝试打开容器时崩溃.

这是有问题的代码行(类似于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","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","variablEID": "1","name": "UA number","type": "c","parameter": [
                    {
                        "type": "TEMPLATE","key": "value","value": "UA-Trackingnumber"
                    }
                ],"fingerprint": "0"
            },{
                "accountId": "197720","variablEID": "3","name": "screen-from","type": "v","key": "name","value": "screen-from"
                    }
                ],"variablEID": "2","name": "screen-name","value": "screen-name"
                    }
                ],"variablEID": "4","name": "view-name","value": "view-name"
                    }
                ],"fingerprint": "0"
            }
        ]
    }
}

任何帮助赞赏.

解决方法

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

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

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

大佬总结

以上是大佬教程为你收集整理的iOS Google跟踪代码管理器在启动时因’NSParseErrorException’而崩溃,原因:’上次标记:116应为124′全部内容,希望文章能够帮你解决iOS Google跟踪代码管理器在启动时因’NSParseErrorException’而崩溃,原因:’上次标记:116应为124′所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。