tvos技术服务_在不支持cocoapods或xcframework支持的情况下为tvos集成firebase crashlytics...

本文主要是介绍tvos技术服务_在不支持cocoapods或xcframework支持的情况下为tvos集成firebase crashlytics...,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

tvos技术服务

Whether you are using legacy build settings in XCode and unable to utilize XCFramework bundles, or Cocoapods for something like security; here is how I went about integrating Firebase Crashlytics for tvOS.

无论您是在XCode中使用旧版构建设置,还是无法利用XCFramework捆绑包或Cocoapods来实现诸如安全性之类的功能; 这就是我为tvOS集成Firebase Crashlytics的方式。

问题 (Problem)

If you are in the same boat as I, you may have come across the following issues on the Firebase Github:

如果您与我同在一条船上,则可能在Firebase Github上遇到以下问题:

  • Integrate FirebaseCrashlytic sdk without CocoaPods and without.xcFramework #5394

    集成不带CocoaPods和不带.xcFramework的FirebaseCrashlytic sdk#5394

  • Binary Firebase Frameworks for tvOS #4550

    tvOS#4550的二进制Firebase框架

There is also the following SO post:

还有以下SO帖子:

  • Integrate Firebase Crashlytics (beta) SDK in iOS project without PODS

    在没有PODS的情况下将Firebase Crashlytics(beta)SDK集成到iOS项目中

Although not provided, it gave me the lead to the solution, “I could not integrate Frameworks. So the solution I followed is adding of Source files provided in https://github.com/firebase/firebase-ios-sdk”. ~ Gangadhar

尽管没有提供,但它带给了我解决方案的线索,“我无法集成框架。 因此,我遵循的解决方案是添加https://github.com/firebase/firebase-ios-sdk中提供的源文件。 〜Gangadhar

(Solution)

There are two ways to accomplish this. You can either clone the Firebase iOS SDK repo found here, and the repos for all other required dependencies. Or, a simpler option is to use Cocoapods to get the required dependencies in a sample project, and move over the source files. I will be demonstrating the latter. Cocoapod source files only include those used, instead of the entire library.

有两种方法可以完成此操作。 您可以克隆在此处找到的Firebase iOS SDK存储库,以及所有其他必需依赖项的存储库。 或者,一个更简单的选择是使用Cocoapods在示例项目中获取所需的依赖项,然后移至源文件。 我将演示后者。 Cocoapod源文件仅包含使用的文件 ,而不包括整个库。

To get started, create a sample tvOS application and give it a pod file with your required dependencies. My Podfile looked like this:

首先,创建一个示例tvOS应用程序,并为其提供一个包含所需依赖项的pod文件。 我的Podfile看起来像这样:

platform :tvos, '10.0'target 'TestProject' do
use_frameworks!
pod 'Firebase/Crashlytics'
end

After running pod install in the project directory, you can then view the Podfile.lock to view all the dependencies and versions. This can be useful as to know dependency version requirements should you go the source from repo approach.

在项目目录中运行pod install之后,您可以查看Podfile.lock以查看所有依赖项和版本。 如果您从回购方法中获取源代码,这对于了解依赖版本要求可能会很有用。

Open up your sample app’s Pods folder, remove the Cocoapod generated files and directories, rename the folder as you wish (ex: “Libraries”), and copy, move, or rename the folder, and add it to your project directory and target.

打开示例应用程序的Pods文件夹,删除Cocoapod生成的文件和目录,根据需要重命名该文件夹(例如:“ Libraries”),然后复制,移动或重命名该文件夹,然后将其添加到项目目录和目标中。

Note: If your project is generated via CMake or some other build system and/or you would like this process automated, refer to the ruby script using xcodeproj at the end of this article. You can than skip this section.

注意:如果您的项目是通过CMake或其他构建系统生成的,并且/或者您希望该过程自动化, 在本文末尾使用xcodeproj 引用ruby脚本您可以跳过此部分。

Image for post
Image for post
Pods/Library file structure
Pod /库文件结构

Once linked, you will have all the source files added to Build Phases -> Compile Sources . If you went the repo route (which contains all library files, regardless if used), you will have the file GULSwizzledObject . This file will throw an error regarding ARC should you have it globally enabled. You must pass the compiler flag of -fno-objc-arc to resolve this. It is reflected in the attached xcodeproj Ruby script.

链接后,您将所有源文件添加到Build Phases -> Compile Sources 。 如果您走了回购路径(包含所有库文件,无论是否使用了它),您将拥有文件GULSwizzledObject 。 如果您全局启用该文件,将引发有关ARC的错误。 您必须传递-fno-objc-arc的编译器标志才能解决此问题。 它反映在随附的xcodeproj Ruby脚本中。

Next, you will need to set the preprocessor macros. Without these you will get compilation errors. You can just look at the Cocoapods framework bundles to see the macros for each framework. Open your .xcworkspace generated by the pod install and view the framework targets. On each one search for Preprocessor Macros or find it under BuildSettings -> Apple Clang — Preprocessing . Copy these into your project target, or use the below script.

接下来,您将需要设置预处理器宏。 没有这些,您将得到编译错误。 您可以只查看Cocoapods框架捆绑包,以查看每个框架的宏。 打开由pod安装生成的.xcworkspace并查看框架目标。 在每一个上搜索Preprocessor Macros或在BuildSettings -> Apple Clang — Preprocessing下找到它。 将它们复制到您的项目目标中,或使用以下脚本。

Image for post

Now you need to specify where these library header files can be found. Update your Header Search Paths accordingly. I made this recursive and just specified my Libraries folder.

现在,您需要指定可以在哪里找到这些库头文件。 相应地更新Header Search Paths 。 我进行了递归操作,并只指定了我的Libraries文件夹。

Lastly, for build settings, set Enable Modules (C and Objective-C) to YES.

最后,对于构建设置,将Enable Modules (C and Objective-C)YES

Firebase设定 (Firebase Setup)

For the rest of the setup, basically just follow Firebase’s instructions on adding your GoogleService-Info.plist , adding your shell script build phase, script and input files, and you should be good to go! All of this is reflect in the script below.

对于其余的设置,基本上只需遵循Firebase的说明添加您的GoogleService-Info.plist ,添加您的Shell脚本构建阶段,脚本和输入文件,就可以了! 所有这些都反映在下面的脚本中。

Ruby脚本 (Ruby Script)

This Ruby script can be easily altered to your needs and project structure. Change you target, paths, and deployment target as needed. This was made to work with some proprietary software so some assumptions are made. You can find the docs for xcodeproj here. The script can be found here:

该Ruby脚本可以轻松地更改为您的需求和项目结构。 根据需要更改目标,路径和部署目标。 这样做是为了与某些专有软件一起使用,因此要进行一些假设。 您可以找到xcodeproj的文档 在这里 脚本可以在这里找到:

https://github.com/JavanPoirier/tvos-crashlytics-testproj/blob/master/xcodeproj.rb

https://github.com/JavanPoirier/tvos-crashlytics-testproj/blob/master/xcodeproj.rb

建造 (Building)

When building you may encounter some import errors or more specifically a “Lexical or Preprocessor Issue” errors. Fix these by changing the imports accordingly. Example, I did have to change line 22 of:

在构建时,您可能会遇到一些导入错误,或更具体地说是“词汇或预处理程序问题”错误。 通过相应地更改导入来解决这些问题。 例如,我确实必须更改第22行:

FirebaseCore/GoogleUtilities/Logger/Private/GULLogger.h

FirebaseCore/GoogleUtilities/Logger/Private/GULLogger.h

Image for post

测试中 (Testing)

You can test your Firebase Crashlytics the exact same way as mentioned in the Firebase documentation. I simply added assert(NO) into my app delegate’s applicationWillResignActive lifecycle method to crash it simply by pressing the Siri button. Note: I did have trouble getting a release build to crash with assert(NO) , not sure why, but @throw/NSInternalInconsistencyException; aslo did the trick. More Obj-C options here.

您可以按照与Firebase文档中所述完全相同的方式测试Firebase Crashlytics。 我只是将assert(NO)添加到我的应用程序委托的applicationWillResignActive生命周期方法中,只需按Siri按钮即可使其崩溃。 注意:我确实很难通过assert(NO)使发行版本崩溃,但不确定为什么,但是@throw/NSInternalInconsistencyException; 阿斯洛做到了。 这里有更多Obj-C选项。

Once deployed, remember to detach the XCode debugger. Otherwise crashes will not be sent to the Firebase Console.

部署后,请记住分离XCode调试器 。 否则,崩溃将不会发送到Firebase控制台。

Image for post

Run and crash the app. Vigorously refresh your Firebase Console under Crashlytics… et voila!

运行并崩溃该应用程序。 在Crashlytics下大力刷新您的Firebase控制台……瞧!

Image for post

The TestProject used for this example is available here:

此示例使用的TestProject在此处可用:

https://github.com/JavanPoirier/tvos-crashlytics-testproj

https://github.com/JavanPoirier/tvos-crashlytics-testproj

If you have questions or feedback I am all ears. If anyone knows of a better way to do this, hit me up. I hope this helps!

如果您有任何疑问或反馈,我会很高兴。 如果有人知道更好的方法,请打我。 我希望这有帮助!

翻译自: https://medium.com/@Javan.Poirier/integrating-firebase-crashlytics-for-tvos-without-cocoapods-or-xcframework-support-a8f4b389c7c2

tvos技术服务


http://www.taodudu.cc/news/show-7882350.html

相关文章:

  • TVOS 2.0
  • tvos 安装kodi_如何将Apple TV更新到tvOS 11
  • QT语言文件制作
  • QT6.3 CMake 多语言切换
  • 树莓派c语言判断io口信号,测试树莓派 USB接口的IO能力
  • 机器学习实战——Topic1使用线性回归构建房价预测模型
  • mysql学习笔记+MacOs
  • df查到磁盘使用率86%,但是du看不到大文件,小文件加起来和df查到的相差巨大
  • 您的主机中的软件中止了一个已建立的连接
  • UVa 10075 - Airlines
  • Realm导入Android中报错
  • 【OpenCV 4】图像积分图算法:integral()
  • 通过 Euler integral
  • Integral Human Pose Regression ECCV 2018
  • 元编程学习: integral_constant
  • python integral_Python Decimal to_integral_exact()用法及代码示例
  • matlab——数值积分integral和integral2
  • python integral_Python Decimal to_integral_value()用法及代码示例
  • OpenCV每日函数 杂项图像转换模块 (5) integral函数 积分图
  • python integral_Python Decimal to_integral()用法及代码示例
  • 机器学习的一些常见算法介绍【线性回归,岭回归,套索回归,弹性网络】
  • Linux指令二
  • bios报警声音大全 破除网页鼠标右键禁用的十大绝招 windows任务管理 xp优化
  • 删除 office2010安装后产生的Q盘
  • 开启Office 2003出现要安装PRO11.MSI解决方法
  • office安装问题
  • distribute mysql
  • Hive的order by、sort by、distribute by和cluster by[附实例]
  • 基于distribute命令的路由过滤配置详解
  • JavaWebJAVAJSP旅游网站JSP旅游信息网站JSP旅游管理系统JSP旅游景区网站JSP旅游系统JSP旅游订票系统
  • 这篇关于tvos技术服务_在不支持cocoapods或xcframework支持的情况下为tvos集成firebase crashlytics...的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



    http://www.chinasem.cn/article/160232

    相关文章

    SpringBoot集成LiteFlow实现轻量级工作流引擎的详细过程

    《SpringBoot集成LiteFlow实现轻量级工作流引擎的详细过程》LiteFlow是一款专注于逻辑驱动流程编排的轻量级框架,它以组件化方式快速构建和执行业务流程,有效解耦复杂业务逻辑,下面给大... 目录一、基础概念1.1 组件(Component)1.2 规则(Rule)1.3 上下文(Conte

    SpringBoot服务获取Pod当前IP的两种方案

    《SpringBoot服务获取Pod当前IP的两种方案》在Kubernetes集群中,SpringBoot服务获取Pod当前IP的方案主要有两种,通过环境变量注入或通过Java代码动态获取网络接口IP... 目录方案一:通过 Kubernetes Downward API 注入环境变量原理步骤方案二:通过

    华为鸿蒙HarmonyOS 5.1官宣7月开启升级! 首批支持名单公布

    《华为鸿蒙HarmonyOS5.1官宣7月开启升级!首批支持名单公布》在刚刚结束的华为Pura80系列及全场景新品发布会上,除了众多新品的发布,还有一个消息也点燃了所有鸿蒙用户的期待,那就是Ha... 在今日的华为 Pura 80 系列及全场景新品发布会上,华为宣布鸿蒙 HarmonyOS 5.1 将于 7

    Java中的登录技术保姆级详细教程

    《Java中的登录技术保姆级详细教程》:本文主要介绍Java中登录技术保姆级详细教程的相关资料,在Java中我们可以使用各种技术和框架来实现这些功能,文中通过代码介绍的非常详细,需要的朋友可以参考... 目录1.登录思路2.登录标记1.会话技术2.会话跟踪1.Cookie技术2.Session技术3.令牌技

    如何搭建并配置HTTPD文件服务及访问权限控制

    《如何搭建并配置HTTPD文件服务及访问权限控制》:本文主要介绍如何搭建并配置HTTPD文件服务及访问权限控制的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、安装HTTPD服务二、HTTPD服务目录结构三、配置修改四、服务启动五、基于用户访问权限控制六、

    使用vscode搭建pywebview集成vue项目实践

    《使用vscode搭建pywebview集成vue项目实践》:本文主要介绍使用vscode搭建pywebview集成vue项目实践,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录环境准备项目源码下载项目说明调试与生成可执行文件核心代码说明总结本节我们使用pythonpywebv

    Maven项目中集成数据库文档生成工具的操作步骤

    《Maven项目中集成数据库文档生成工具的操作步骤》在Maven项目中,可以通过集成数据库文档生成工具来自动生成数据库文档,本文为大家整理了使用screw-maven-plugin(推荐)的完... 目录1. 添加插件配置到 pom.XML2. 配置数据库信息3. 执行生成命令4. 高级配置选项5. 注意事

    Java集成Onlyoffice的示例代码及场景分析

    《Java集成Onlyoffice的示例代码及场景分析》:本文主要介绍Java集成Onlyoffice的示例代码及场景分析,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要... 需求场景:实现文档的在线编辑,团队协作总结:两个接口 + 前端页面 + 配置项接口1:一个接口,将o

    Swagger2与Springdoc集成与使用详解

    《Swagger2与Springdoc集成与使用详解》:本文主要介绍Swagger2与Springdoc集成与使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录1. 依赖配置2. 基础配置2.1 启用 Springdoc2.2 自定义 OpenAPI 信息3.

    宝塔安装的MySQL无法连接的情况及解决方案

    《宝塔安装的MySQL无法连接的情况及解决方案》宝塔面板是一款流行的服务器管理工具,其中集成的MySQL数据库有时会出现连接问题,本文详细介绍两种最常见的MySQL连接错误:“1130-Hostisn... 目录一、错误 1130:Host ‘xxx.xxx.xxx.xxx’ is not allowed