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

    相关文章

    Docker部署Jenkins持续集成(CI)工具的实现

    《Docker部署Jenkins持续集成(CI)工具的实现》Jenkins是一个流行的开源自动化工具,广泛应用于持续集成(CI)和持续交付(CD)的环境中,本文介绍了使用Docker部署Jenkins... 目录前言一、准备工作二、设置变量和目录结构三、配置 docker 权限和网络四、启动 Jenkins

    springboot的调度服务与异步服务使用详解

    《springboot的调度服务与异步服务使用详解》本文主要介绍了Java的ScheduledExecutorService接口和SpringBoot中如何使用调度线程池,包括核心参数、创建方式、自定... 目录1.调度服务1.1.JDK之ScheduledExecutorService1.2.spring

    Qt 中集成mqtt协议的使用方法

    《Qt中集成mqtt协议的使用方法》文章介绍了如何在工程中引入qmqtt库,并通过声明一个单例类来暴露订阅到的主题数据,本文通过实例代码给大家介绍的非常详细,感兴趣的朋友一起看看吧... 目录一,引入qmqtt 库二,使用一,引入qmqtt 库我是将整个头文件/源文件都添加到了工程中进行编译,这样 跨平台

    Debezium 与 Apache Kafka 的集成方式步骤详解

    《Debezium与ApacheKafka的集成方式步骤详解》本文详细介绍了如何将Debezium与ApacheKafka集成,包括集成概述、步骤、注意事项等,通过KafkaConnect,D... 目录一、集成概述二、集成步骤1. 准备 Kafka 环境2. 配置 Kafka Connect3. 安装 D

    Spring AI集成DeepSeek的详细步骤

    《SpringAI集成DeepSeek的详细步骤》DeepSeek作为一款卓越的国产AI模型,越来越多的公司考虑在自己的应用中集成,对于Java应用来说,我们可以借助SpringAI集成DeepSe... 目录DeepSeek 介绍Spring AI 是什么?1、环境准备2、构建项目2.1、pom依赖2.2

    Android 悬浮窗开发示例((动态权限请求 | 前台服务和通知 | 悬浮窗创建 )

    《Android悬浮窗开发示例((动态权限请求|前台服务和通知|悬浮窗创建)》本文介绍了Android悬浮窗的实现效果,包括动态权限请求、前台服务和通知的使用,悬浮窗权限需要动态申请并引导... 目录一、悬浮窗 动态权限请求1、动态请求权限2、悬浮窗权限说明3、检查动态权限4、申请动态权限5、权限设置完毕后

    定价129元!支持双频 Wi-Fi 5的华为AX1路由器发布

    《定价129元!支持双频Wi-Fi5的华为AX1路由器发布》华为上周推出了其最新的入门级Wi-Fi5路由器——华为路由AX1,建议零售价129元,这款路由器配置如何?详细请看下文介... 华为 Wi-Fi 5 路由 AX1 已正式开售,新品支持双频 1200 兆、配有四个千兆网口、提供可视化智能诊断功能,建

    TP-Link PDDNS服将于务6月30日正式停运:用户需转向第三方DDNS服务

    《TP-LinkPDDNS服将于务6月30日正式停运:用户需转向第三方DDNS服务》近期,路由器制造巨头普联(TP-Link)在用户群体中引发了一系列重要变动,上个月,公司发出了一则通知,明确要求所... 路由器厂商普联(TP-Link)上个月发布公告要求所有用户必须完成实名认证后才能继续使用普联提供的 D

    微服务架构之使用RabbitMQ进行异步处理方式

    《微服务架构之使用RabbitMQ进行异步处理方式》本文介绍了RabbitMQ的基本概念、异步调用处理逻辑、RabbitMQ的基本使用方法以及在SpringBoot项目中使用RabbitMQ解决高并发... 目录一.什么是RabbitMQ?二.异步调用处理逻辑:三.RabbitMQ的基本使用1.安装2.架构

    Java中使用Java Mail实现邮件服务功能示例

    《Java中使用JavaMail实现邮件服务功能示例》:本文主要介绍Java中使用JavaMail实现邮件服务功能的相关资料,文章还提供了一个发送邮件的示例代码,包括创建参数类、邮件类和执行结... 目录前言一、历史背景二编程、pom依赖三、API说明(一)Session (会话)(二)Message编程客