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

    相关文章

    Linux创建服务使用systemctl管理详解

    《Linux创建服务使用systemctl管理详解》文章指导在Linux中创建systemd服务,设置文件权限为所有者读写、其他只读,重新加载配置,启动服务并检查状态,确保服务正常运行,关键步骤包括权... 目录创建服务 /usr/lib/systemd/system/设置服务文件权限:所有者读写js,其他

    Java服务实现开启Debug远程调试

    《Java服务实现开启Debug远程调试》文章介绍如何通过JVM参数开启Java服务远程调试,便于在线上排查问题,在IDEA中配置客户端连接,实现无需频繁部署的调试,提升效率... 目录一、背景二、相关图示说明三、具体操作步骤1、服务端配置2、客户端配置总结一、背景日常项目中,通常我们的代码都是部署到远程

    Java中的Schema校验技术与实践示例详解

    《Java中的Schema校验技术与实践示例详解》本主题详细介绍了在Java环境下进行XMLSchema和JSONSchema校验的方法,包括使用JAXP、JAXB以及专门的JSON校验库等技术,本文... 目录1. XML和jsON的Schema校验概念1.1 XML和JSON校验的必要性1.2 Sche

    SpringBoot集成WebService(wsdl)实践

    《SpringBoot集成WebService(wsdl)实践》文章介绍了SpringBoot项目中通过缓存IWebService接口实现类的泛型入参类型,减少反射调用提升性能的实现方案,包含依赖配置... 目录pom.XML创建入口ApplicationContextUtils.JavaJacksonUt

    springboot集成easypoi导出word换行处理过程

    《springboot集成easypoi导出word换行处理过程》SpringBoot集成Easypoi导出Word时,换行符n失效显示为空格,解决方法包括生成段落或替换模板中n为回车,同时需确... 目录项目场景问题描述解决方案第一种:生成段落的方式第二种:替换模板的情况,换行符替换成回车总结项目场景s

    SpringBoot集成redisson实现延时队列教程

    《SpringBoot集成redisson实现延时队列教程》文章介绍了使用Redisson实现延迟队列的完整步骤,包括依赖导入、Redis配置、工具类封装、业务枚举定义、执行器实现、Bean创建、消费... 目录1、先给项目导入Redisson依赖2、配置redis3、创建 RedissonConfig 配

    sysmain服务可以禁用吗? 电脑sysmain服务关闭后的影响与操作指南

    《sysmain服务可以禁用吗?电脑sysmain服务关闭后的影响与操作指南》在Windows系统中,SysMain服务(原名Superfetch)作为一个旨在提升系统性能的关键组件,一直备受用户关... 在使用 Windows 系统时,有时候真有点像在「开盲盒」。全新安装系统后的「默认设置」,往往并不尽编

    SpringBoot集成XXL-JOB实现任务管理全流程

    《SpringBoot集成XXL-JOB实现任务管理全流程》XXL-JOB是一款轻量级分布式任务调度平台,功能丰富、界面简洁、易于扩展,本文介绍如何通过SpringBoot项目,使用RestTempl... 目录一、前言二、项目结构简述三、Maven 依赖四、Controller 代码详解五、Service

    Python 基于http.server模块实现简单http服务的代码举例

    《Python基于http.server模块实现简单http服务的代码举例》Pythonhttp.server模块通过继承BaseHTTPRequestHandler处理HTTP请求,使用Threa... 目录测试环境代码实现相关介绍模块简介类及相关函数简介参考链接测试环境win11专业版python

    Nginx中配置使用非默认80端口进行服务的完整指南

    《Nginx中配置使用非默认80端口进行服务的完整指南》在实际生产环境中,我们经常需要将Nginx配置在其他端口上运行,本文将详细介绍如何在Nginx中配置使用非默认端口进行服务,希望对大家有所帮助... 目录一、为什么需要使用非默认端口二、配置Nginx使用非默认端口的基本方法2.1 修改listen指令