架构armv7的未定义符号:“_OBJC_CLASS _ $ _ GGLContext”,引用自:AppDelegate.o中的objc-class-ref [英] Undefined symbols for architecture armv7: "_OBJC_CLASS_$_GGLContext", referenced from: objc-class-ref in AppDelegate.o

查看:423
本文介绍了架构armv7的未定义符号:“_OBJC_CLASS _ $ _ GGLContext”,引用自:AppDelegate.o中的objc-class-ref的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试在我的iSO应用中添加Google Analytics,并使用Google Analytics最新SDK
https://developers.google.com/analytics/devguides/collection/ios/v3/



已添加所有必需的标题和框架成功地完成了我的项目。但是,在运行我的应用程序时,我得到了以下错误:
$ b $ ol

  • (null):_OBJC_CLASS _ $ _ GGLContext,引用来自:objc- AppDelegate.o中的class-ref


  • (null):链接器命令失败,退出代码1(使用-v查看调用)


  • 以下是我在AppDelegate.m文件中写的代码

      //从GoogleService-Info.plist中配置跟踪器。 
    NSError * configureError;
    [[GGLContext sharedInstance] configureWithError:& configureError];
    NSAssert(!configureError,@配置Google服务时出错:%@,configureError);

    //可选:配置GAI选项。
    GAI * gai = [GAI sharedInstance];
    gai.trackUncaughtExceptions = YES; //报告未捕获的异常
    gai.logger.logLevel = kGAILogLevelVerbose; //删除应用发布之前

    还包括(_OBJC_CLASS _ $ _ GIDSignInButton和_OBJC_CLASS _ $ _ GIDSignIn)
    请告诉我缺少的东西。

    OTHER_LDFLAGS 编译设置。这是主要问题。在其他链接器标志的新行中添加$(继承)后解决了我的问题。


    I am trying to add Google Analytics in my iSO app and I am using Google Analytics latest SDK https://developers.google.com/analytics/devguides/collection/ios/v3/.

    Added all required header and frameworks to my project successfully. But while running my app I am getting below errors

    1. (null): "_OBJC_CLASS_$_GGLContext", referenced from:objc-class-ref in AppDelegate.o

    2. (null): Linker command failed with exit code 1 (use -v to see invocation)

    Below is the code which I am writtig in AppDelegate.m file

    // Configure tracker from GoogleService-Info.plist.
    NSError *configureError;
    [[GGLContext sharedInstance] configureWithError:&configureError];
    NSAssert(!configureError, @"Error configuring Google services: %@", configureError);
    
    // Optional: configure GAI options.
    GAI *gai = [GAI sharedInstance];
    gai.trackUncaughtExceptions = YES;  // report uncaught exceptions
    gai.logger.logLevel = kGAILogLevelVerbose;  // remove before app release
    

    Also includes (_OBJC_CLASS_$_GIDSignInButton and _OBJC_CLASS_$_GIDSignIn) Please tell what I am missing. Thanks in advance.

    解决方案

    "The OPN [Debug] target overrides the OTHER_LDFLAGS build setting". This was the main issue. After adding $(inherited) in new line in other linker flags solved my issue.

    这篇关于架构armv7的未定义符号:“_OBJC_CLASS _ $ _ GGLContext”,引用自:AppDelegate.o中的objc-class-ref的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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