Crash when Use Firebase Analytics in a project SDK Cocoa Touch Framework

帅比萌擦擦* 提交于 2019-11-30 09:31:09

问题


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
                                 }];

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

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

}
  • 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


回答1:


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>

and also followed all the integration instructions in README file.

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



来源:https://stackoverflow.com/questions/47544216/crash-when-use-firebase-analytics-in-a-project-sdk-cocoa-touch-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!