添加Google转换跟踪SDK iOS-3.0.0时,应用程序崩溃 [英] App crash when add Google Conversion Tracking SDK iOS-3.0.0

查看:214
本文介绍了添加Google转换跟踪SDK iOS-3.0.0时,应用程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将GoogleConversionTrackingSDK添加到我的项目中,然后调用函数: [ACTConversionReporter reportWithConversionID:@972050884label:@Bzk1CIzPkAkQxKPBzwMvalue:@0isRepeatable:NO];
然后我的应用程序崩溃。这是堆栈跟踪:

 'NSInvalidArgumentException',原因:'+ [NSDate act_secondsSince1970]:无法识别的选择器发送到类0x10225d8d0' 
***第一次抛出调用堆栈:

0 CoreFoundation 0x000000010210f495 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101bd499e objc_exception_throw + 43
2 CoreFoundation 0x00000001021a055d + [ NSObject(NSObject)doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000102100d8d ___forwarding___ + 973
4 CoreFoundation 0x0000000102100938 _CF_forwarding_prep_0 + 120
5 TestMoboSDK-Client 0x00000001000143cb - [ACTReporterPrivate commonQueryParameters] + 84
6 TestMoboSDK-Client 0x0000000100014779 - [ACTReporterPrivate report] + 98
7 TestMoboSDK-Client 0x00000001 0001177a - [ACTReporter report] + 75
8 TestMoboSDK-Client 0x00000001000118d4 + [ACTConversionReporter reportWithConversionID:label:value:isRepeatable:] + 170
9 TestMoboSDK-客户端0x0000000100001de6 - [MoboSDK analytics] + 342
10 TestMoboSDK-Client 0x0000000100001c16 __20- [MoboSDK googleSDK] _block_invoke + 38
11 libdispatch.dylib 0x00000001027fd72d _dispatch_client_callout + 8
12 libdispatch.dylib 0x00000001027ee85f dispatch_once_f + 82
13 TestMoboSDK-客户端0x0000000100001bea - MoboSDK googleSDK] + 122
14 TestMoboSDK-Client 0x0000000100001b53 - [MoboSDK init] + 899
15 TestMoboSDK-Client 0x0000000100001eb2 __17 + [MoboSDK shared] _block_invoke + 50
16 libdispatch.dylib 0x00000001027fd72d _dispatch_client_callout + 8
17 libdispatch.dylib 0x00000001027ee85f dispatch_once_f + 82
18 TestMoboSDK-Client 0x0000000100001e6a +​​ [MoboSDK shared] + 122
19 TestMoboSDK-Client 0x000000010000566e - [ViewController supportedInterfaceOrientations] + 254
20 UIKit 0x000000010088568b - [UIViewController __supportedInterfaceOrientations] + 378
21 UIKit 0x000000010087f7be - [UIViewController _preferredInterfaceOrientationGivenStatusBarAndDeviceAndOrientation:] + 59
22 UIKit 0x00000001007b7ef6 - [UIWindow setRootViewController:] + 103
23 TestMoboSDK-Client 0x00000001000078f0 - [AppDelegate application:didFinishLaunchingWithOptions:] + 464
24 UIKit 0x000000010077c3d9 - [UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 264
25 UIKit 0x000000010077cbe1 - [UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1605
26 UIKit 0x0000000100780a0c - [UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 660
27 UIKit 0x0000000100791d4c - [UIApplication handleEvent:withNewEvent: ] + 3189
28 UIKit 0x0000000100792216 - [UIApplication sendEvent:] + 79
29 UIKit 0x0000000100782086 _UIApplicationHandleEvent + 578
30 GraphicsServices 0x00000001035a171a _PurpleEventCallback + 762
31 GraphicsServices 0x00000001035a11e1 PurpleEventCallback + 35
32 CoreFoundation 0x0000000102091679 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
33 CoreFoundation 0x000000010209144e __CFRunLoopDoSource1 + 478
34 CoreFoundation 0x00000001020ba903 __CFRunLoopRun + 1939
35 CoreFoundation 0x00000001020b9d83 CFRunLoopRunSpecific + 467
36 UIKit 0x00000001007802e1 - [UIApplication _run] + 609
37 UIKit 0x0000000100781e33 UIApplicationMain + 1010
38 TestMoboSDK-客户端0x000000010000b44a main + 138
39 TestMoboSDK-Client 0x00000001000017c4 start + 52
40 0x000000000000000 0x0 + 1

libc ++ abi.dylib:以NSException类型的未捕获异常终止

我也尝试了一个新项目来添加这个SDK,但得到了同样的崩溃。如果GoogleConversionTrackingSDK-iOS-3.0.0支持iOS 7或不支持?需要指导我在这里做错了什么,或者如果我错过了某些东西。



谢谢。

解决方案

出现此问题是因为google在静态库中使用了类别

解决方案非常简单,您需要通知链接器有关该方面的信息





1 )点击项目

2)点击目标

3)打开构建设置标签

)搜索其他链接标记



$ b $ 5双击其他链接器标志

6)添加 -ObjC -all_load 标记

7)

删除二进制文件(从设备/模拟器中删除),

清理项目(打开 cmd + shift + k )和

再次构建(打击 cmd + b ) )。



你准备好了!


I am adding GoogleConversionTrackingSDK into my project and then calling the function: [ACTConversionReporter reportWithConversionID:@"972050884" label:@"Bzk1CIzPkAkQxKPBzwM" value:@"0" isRepeatable:NO]; then my app crash. Here is the stack trace:

   'NSInvalidArgumentException', reason: '+[NSDate act_secondsSince1970]: unrecognized selector sent to class 0x10225d8d0'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010210f495 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000101bd499e objc_exception_throw + 43
    2   CoreFoundation                      0x00000001021a055d +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x0000000102100d8d ___forwarding___ + 973
    4   CoreFoundation                      0x0000000102100938 _CF_forwarding_prep_0 + 120
    5   TestMoboSDK-Client                  0x00000001000143cb -[ACTReporterPrivate commonQueryParameters] + 84
    6   TestMoboSDK-Client                  0x0000000100014779 -[ACTReporterPrivate report] + 98
    7   TestMoboSDK-Client                  0x000000010001177a -[ACTReporter report] + 75
    8   TestMoboSDK-Client                  0x00000001000118d4 +[ACTConversionReporter reportWithConversionID:label:value:isRepeatable:] + 170
    9   TestMoboSDK-Client                  0x0000000100001de6 -[MoboSDK analytics] + 342
    10  TestMoboSDK-Client                  0x0000000100001c16 __20-[MoboSDK googleSDK]_block_invoke + 38
    11  libdispatch.dylib                   0x00000001027fd72d _dispatch_client_callout + 8
    12  libdispatch.dylib                   0x00000001027ee85f dispatch_once_f + 82
    13  TestMoboSDK-Client                  0x0000000100001bea -[MoboSDK googleSDK] + 122
    14  TestMoboSDK-Client                  0x0000000100001b53 -[MoboSDK init] + 899
    15  TestMoboSDK-Client                  0x0000000100001eb2 __17+[MoboSDK shared]_block_invoke + 50
    16  libdispatch.dylib                   0x00000001027fd72d _dispatch_client_callout + 8
    17  libdispatch.dylib                   0x00000001027ee85f dispatch_once_f + 82
    18  TestMoboSDK-Client                  0x0000000100001e6a +[MoboSDK shared] + 122
    19  TestMoboSDK-Client                  0x000000010000566e -[ViewController supportedInterfaceOrientations] + 254
    20  UIKit                               0x000000010088568b -[UIViewController __supportedInterfaceOrientations] + 378
    21  UIKit                               0x000000010087f7be -[UIViewController _preferredInterfaceOrientationGivenStatusBarAndDeviceAndOrientation:] + 59
    22  UIKit                               0x00000001007b7ef6 -[UIWindow setRootViewController:] + 103
    23  TestMoboSDK-Client                  0x00000001000078f0 -[AppDelegate application:didFinishLaunchingWithOptions:] + 464
    24  UIKit                               0x000000010077c3d9 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 264
    25  UIKit                               0x000000010077cbe1 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1605
    26  UIKit                               0x0000000100780a0c -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 660
    27  UIKit                               0x0000000100791d4c -[UIApplication handleEvent:withNewEvent:] + 3189
    28  UIKit                               0x0000000100792216 -[UIApplication sendEvent:] + 79
    29  UIKit                               0x0000000100782086 _UIApplicationHandleEvent + 578
    30  GraphicsServices                    0x00000001035a171a _PurpleEventCallback + 762
    31  GraphicsServices                    0x00000001035a11e1 PurpleEventCallback + 35
    32  CoreFoundation                      0x0000000102091679 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
    33  CoreFoundation                      0x000000010209144e __CFRunLoopDoSource1 + 478
    34  CoreFoundation                      0x00000001020ba903 __CFRunLoopRun + 1939
    35  CoreFoundation                      0x00000001020b9d83 CFRunLoopRunSpecific + 467
    36  UIKit                               0x00000001007802e1 -[UIApplication _run] + 609
    37  UIKit                               0x0000000100781e33 UIApplicationMain + 1010
    38  TestMoboSDK-Client                  0x000000010000b44a main + 138
    39  TestMoboSDK-Client                  0x00000001000017c4 start + 52
    40  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

I also tried a fresh project to add this SDK but got the same crash.If GoogleConversionTrackingSDK-iOS-3.0.0 is support for iOS 7 or not? Need guidance on what am I doing wrong here or if I am missing something.

Thanks.

解决方案

This problem appears because google has used categories in static library
The solution is super simple, you need to notify linker about that

1) Click on the project
2) Click on the target
3) Open Build Settings tab
4) Search for Other Linker Flags

5) Double click on Other Linker Flags
6) Add -ObjC and -all_load flags
7)
Remove binary (delete from device/simulator),
Clean project (hitting cmd+shift+k) and
build again (hitting cmd+b).

You're ready to go!

这篇关于添加Google转换跟踪SDK iOS-3.0.0时,应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆