在项目SDK Cocoa Touch Framework中使用Firebase Analytics时崩溃 [英] Crash when Use Firebase Analytics in a project SDK Cocoa Touch Framework

查看:162
本文介绍了在项目SDK Cocoa Touch Framework中使用Firebase Analytics时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个CocoaTouch Framework SDK,它使用Firebase库进行检查。但是,我有以下问题:
- 向SDK添加了Firebase Analytics,构建成功,但是如果在SDK中有一个函数调用 FIRAnalytics ,例如:

I created a CocoaTouch Framework SDK, which uses the Firebase library for checking. However, I have the following problem: - Added Firebase Analytics to the SDK, build successful, however if in SDK there is a function call in the class FIRAnalytics, for example:

[FIRAnalytics logEventWithName:@"share_image"
                    parameters:@{
                                 @"name": name,
                                 @"full_text": text
                                 }];

然后在项目A(示例)中使用我们的SDK在函数中崩溃:

Then in Project A(example) using our SDK crashed in the function:

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];

}




  • 如果我们的SDK没有在 FIRAnalytics 类中调用函数,项目A不会崩溃

  • 我们尝试在项目A中直接使用Firebase而不是崩溃

  • 我在没有CocoaPods的情况下进行整合

    • If our SDK does not call functions in the FIRAnalytics class, Project A will not crash
    • We tried using Firebase directly in project A too not crashed
    • I Integrate without CocoaPods
    • 推荐答案

      对于想要在没有cocoapods的swift框架中使用firebase sdks的人,我设法解决了这个崩溃只是将以下#import添加到框架的公共头文件YourCocoaTouchFrameworkNameSwift.h

      For people who wants to use firebase sdks in swift framework without cocoapods, I managed to resolve this crash by just adding following #import to framework's public header file "YourCocoaTouchFrameworkNameSwift.h"

      #import <YourCocoaTouchFrameworkName/Firebase.h>
      

      并遵循 README 文件。

      你可以查看我的示例cocoa touch框架和项目 github

      You can checkout my sample cocoa touch framework and project on github

      这篇关于在项目SDK Cocoa Touch Framework中使用Firebase Analytics时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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