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

    相关文章

    Python实现快速扫描目标主机的开放端口和服务

    《Python实现快速扫描目标主机的开放端口和服务》这篇文章主要为大家详细介绍了如何使用Python编写一个功能强大的端口扫描器脚本,实现快速扫描目标主机的开放端口和服务,感兴趣的小伙伴可以了解下... 目录功能介绍场景应用1. 网络安全审计2. 系统管理维护3. 网络故障排查4. 合规性检查报错处理1.

    Spring Boot 集成 mybatis核心机制

    《SpringBoot集成mybatis核心机制》这篇文章给大家介绍SpringBoot集成mybatis核心机制,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值... 目录Spring Boot浅析1.依赖管理(Starter POMs)2.自动配置(AutoConfigu

    SpringBoot集成iText快速生成PDF教程

    《SpringBoot集成iText快速生成PDF教程》本文介绍了如何在SpringBoot项目中集成iText9.4.0生成PDF文档,包括新特性的介绍、环境准备、Service层实现、Contro... 目录SpringBoot集成iText 9.4.0生成PDF一、iText 9新特性与架构变革二、环

    nacos服务无法注册到nacos服务中心问题及解决

    《nacos服务无法注册到nacos服务中心问题及解决》本文详细描述了在Linux服务器上使用Tomcat启动Java程序时,服务无法注册到Nacos的排查过程,通过一系列排查步骤,发现问题出在Tom... 目录简介依赖异常情况排查断点调试原因解决NacosRegisterOnWar结果总结简介1、程序在

    JAVA SpringBoot集成Jasypt进行加密、解密的详细过程

    《JAVASpringBoot集成Jasypt进行加密、解密的详细过程》文章详细介绍了如何在SpringBoot项目中集成Jasypt进行加密和解密,包括Jasypt简介、如何添加依赖、配置加密密钥... 目录Java (SpringBoot) 集成 Jasypt 进行加密、解密 - 详细教程一、Jasyp

    python协程实现高并发的技术详解

    《python协程实现高并发的技术详解》协程是实现高并发的一种非常高效的方式,特别适合处理大量I/O操作的场景,本文我们将简单介绍python协程实现高并发的相关方法,需要的小伙伴可以了解下... 目录核心概念与简单示例高并发实践:网络请求协程如何实现高并发:核心技术协作式多任务与事件循环非阻塞I/O与连接

    golang实现nacos获取配置和服务注册-支持集群详解

    《golang实现nacos获取配置和服务注册-支持集群详解》文章介绍了如何在Go语言中使用Nacos获取配置和服务注册,支持集群初始化,客户端结构体中的IpAddresses可以配置多个地址,新客户... 目录golang nacos获取配置和服务注册-支持集群初始化客户端可选参数配置new一个客户端 支

    springBoot (springCloud2025)集成redisCluster 集群的操作方法

    《springBoot(springCloud2025)集成redisCluster集群的操作方法》文章介绍了如何使用SpringBoot集成RedisCluster集群,并详细说明了pom.xm... 目录pom.XMLapplication.yamlcluster配置类其他配置类连接池配置类Redis

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

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

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

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