当前位置: 首页 > news >正文

uniapp ios app以framwork形式接入sentry

一、下载Sentry

  1. mac终端输入:vim Podfile
  2. 修改Podfile:
platform :ios, '11.0'
target 'YourApp' douse_frameworks! # This is importantpod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '8.40.1'
end
  1. 执行:pod install下载sentry依赖

二、配置sentry

  1. 把开发教程的东西配置完:https://nativesupport.dcloud.net.cn/NativePlugin/course/ios.html
  2. 新建SentryModule.h文件,内容如下:
#import <Foundation/Foundation.h>
// 引入 DCUniModule.h 头文件
#import "DCUniModule.h"@interface SentryModule: DCUniModule@end
  1. 新建SentryModule.m文件,内容如下:
#import "SentryModule.h"
#import <Sentry/Sentry.h>
@implementation SentryModule
UNI_EXPORT_METHOD_SYNC(@selector(init:))
- (void)init:(NSDictionary *)appOpt
{[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {options.dsn = appOpt[@"dsn"];options.debug = YES; // Enabled debug when first installing is always helpful// Enable tracing to capture 100% of transactions for tracing.// Use 'options.tracesSampleRate' to set the sampling rate.// 想要什么配置自己加}];
}
  1. 使用插件参考:https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios.html

ps: 其他报错

报错’Sentry/Sentry.h’ file not found 解决方法:

  1. pod install 会生成一个 .xcworkspace 文件,如果没有就是安装失败了;
  2. 在 Xcode 中打开项目时,应该打开这个 .xcworkspace 文件,而不是原始的 .xcodeproj 文件。否则,Xcode 将无法找到通过 CocoaPods 安装的依赖框架,包括 Sentry。

打包时报错 No type named “terminate_handler" in namespace ‘std’ 总结解决方法:参考此贴

  1. 升级xcode到16.0或以上
  2. sentry安装8.32.0以上,我安装的是8.40.1
http://www.lryc.cn/news/485247.html

相关文章:

  • ⾃动化运维利器Ansible-基础
  • 若依笔记(十一):芋道多租户限制与修改
  • hive 统计各项目下排名前5的问题种类
  • HBase 安装与基本操作指南
  • Spring Boot应用中的文件压缩与解压技术实践
  • D69【 python 接口自动化学习】- python 基础之数据库
  • 410. 分割数组的最大值
  • Azure pipeline 通过git命令修改文件
  • LeetCode74. 搜索二维矩阵(2024冬季每日一题 6)
  • BPMN 2.0详细介绍
  • web——upload-labs——第四关——.htaccess文件绕过
  • 36.矩阵格式的等差数列 C语言
  • Java 语言的强大特性
  • ElementUI的日期组件中禁止选择小时、分钟、秒
  • 4.2 Android NDK 基础概念
  • PIL包在Python图像处理中的应用
  • ArcGIS Pro ADCore DAML
  • Clip结合Faiss+Flask简易版文搜图服务
  • 【机器学习】数学知识:欧式距离(Euclidean Distance)和曼哈顿距离(Manhattan Distance)
  • Redis 概 述 和 安 装
  • 数据仓库面试题集离线实时
  • Spring Boot框架:电商系统的技术革新
  • 一键抠图:免费安全的在线图片去除背景工具
  • vue项目PC端和移动端实现在线预览pptx文件
  • uniapp适配暗黑模式配置plus.nativeUI.setUIStyle适配DarkMode配置
  • EXCEL 或 WPS 列下划线转驼峰
  • 走进Linux的历史发展史
  • 学习yum工具,进行安装软件
  • union介绍及使用
  • 安全,服务器证书和SSL连接