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

使用 pushy 热更新后 sentry 不能正常显示源码

问题

使用 Android Studio 打包后,上传使用 sentry 官网命令打包的 sourcemap 文件,sentry能正常显示异常位置源码。
使用 pushy 热更新之后,sentry 不能正常显示异常位置的源代码。

如下图:

在这里插入图片描述

在这里插入图片描述

问题原因:

使用 pushy 完成 app 的热更新功能,同时使用 sentry 对应用异常监控,热更新后由于没有 sourcemap,sentry 监控到的异常也就不能正常显示源码。

sentry 官方给的生成的 map 文件的命令:

npx react-native bundle \ 
  --dev false \ 
  --platform android \ 
  --entry-file index.js \ 
  --reset-cache \ 
  --bundle-output index.android.bundle \ 
  --sourcemap-output index.android.bundle.map

原因就是热更新之后包变成了 index.bundlejs,但是却并没有上传 index.bundlejsindex.bundlejs.map文件到 sentry。

解决办法:

pushy 在生成 ppk 热更新包的时候,传递参数 --sourcemap 控制 sourcemap生成。
如果开启,则能在 intermedia 目录中生成对应源码的 sourcemap 上传到 sentry。

pushy bundle --platform android --sourcemap

生成的 sourcemap 文件路径

Welcome to Metro v0.76.7
              Fast - Scalable - Integrated
Debug ID module found. Skipping Sentry Debug ID module...
info Bundle Debug ID: 4b0ea199-25af-4b7c-9a99-372ee72aec80
info Writing bundle output to:, .pushy/intermedia/android/index.bundlejs
info Writing sourcemap output to:, .pushy/intermedia/android/index.bundlejs.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 160 asset files
info Done copying assets
Packing
ppk热更包已生成并保存到: .pushy/output/android.1735476299841.ppk

http://www.kler.cn/a/458035.html

相关文章:

  • 玉米中的元基因调控网络突出了功能上相关的调控相互作用。/biosample_parser.py
  • 秒鲨后端之MyBatis【2】默认的类型别名、MyBatis的增删改查、idea中设置文件的配置模板、MyBatis获取参数值的两种方式、特殊SQL的执行
  • py打包工具
  • Python + 深度学习从 0 到 1(02 / 99)
  • 基于深度学习(HyperLPR3框架)的中文车牌识别系统-Qt调用Python
  • 在vue3中使用tsx结合render封装一个项目内通用的弹窗组件
  • Docker的概述与安装
  • 算法基础一:冒泡排序
  • React引入Echart水球图
  • systemverilog语法:assertion sequence
  • node-js Express防盗链
  • Spring Boot 多数据源解决方案:dynamic-datasource-spring-boot-starter 的奥秘(下)
  • 1.flask介绍、入门、基本用法
  • Python-网络爬虫
  • Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin(自测问题解决!)
  • 【每日学点鸿蒙知识】页面反向传值、图片撑满问题、清除Web缓存、Refresh支持swiper、POP颜色没效果
  • 验证ETL程序产生数据的正确性以及确保数据质量的方法
  • 【畅购商城】详情页详情之商品详情
  • Windows下C++使用SQLite
  • 手机联系人 查询 添加操作