跳转至

故障排查

开启 Debug 调试

您可以通过以下配置,开启 SDK 的 Debug 功能,开启之后 Android 系统,您可以直接在 Flutter 编译工具上看到输出的 Debug 日志,iOS 您需要通过 Xcode 编译运行,Xcode 编译,或者通过 MacOS 控制台应用查看。

FTMobileFlutter.sdkConfig(
      serverUrl: serverUrl,
      debug: true, // 开启 debug 模式
  );

注意:建议 Release 版本发布时,关闭这个配置。

Android LogcatiOS Xcode Console 日志示例

SDK 正常运行但是没有数据

  • 排查 Datakit 是否正常运行

  • 确认 SDK 上传地址datakitUrldatawayUrl配置正确,并正确初始化。debug 模式下, 查看 Android LogcatiOS Xcode Console 的同步日志。

  • datakit 是否往对应工作空间上传数据,是否处于离线状态。这个可以通过登录观测云,查看「基础设施」来确认这个问题。

编译过程中 pod 发生错误

CocoaPods could not find compatible versions for pod "FTMobileSDK/FTMobileAgent"

[!] CocoaPods could not find compatible versions for pod "FTMobileSDK/FTMobileAgent":
  In snapshot (Podfile.lock):
    FTMobileSDK/FTMobileAgent (= 1.3.9-alpha.14)

  In Podfile:
    ft_mobile_agent_flutter (from `.symlinks/plugins/ft_mobile_agent_flutter/ios`) was resolved to 0.0.2, which depends on
      FTMobileSDK/FTMobileAgent (= 1.3.10-beta.2)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `FTMobileSDK/FTMobileAgent` inside your development pod `ft_mobile_agent_flutter`.
   You should run `pod update FTMobileSDK/FTMobileAgent` to apply changes you've made.

如果编译 iOS 应用时碰到类似版本导入这个问题,您需要在终端在 flutter 项目的 ios 文件,执行以下命令:

pod install --repo-update

The Swift pod ft_mobile_agent_flutter depends upon FTMobileSDK, which does not define modules

ft_mobile_agent_flutter ≤ 0.5.6 若 CocoaPods 配置未显式指定 use_module_headers!use_frameworks!,执行 pod install 时会触发如下报错:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `ft_mobile_agent_flutter` depends upon `FTMobileSDK`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

问题原因ft_mobile_agent_flutter(Swift 开发)依赖 OC 库 FTMobileSDK,因 FTMobileSDK.podspec 缺少 DEFINES_MODULE = YES 配置,导致 iOS 静态库编译时报找不到 module。

解决方法:在您项目的 Podfile 文件 target 'Runner' do 代码块内添加如下配置:

target 'Runner' do
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  pod 'FTMobileSDK', :modular_headers => true
end

注意:添加 :modular_headers => true 仅为编译配置补充,并非重复引入 SDK;

数据丢失

丢失部份数据

  • 如果丢失 RUM 某一个 Session 数据或 Log,Trace 中的几条数据时,首先需要排除是否在 FTRUMManager.setConfig, FTLogger.logConfig, FTTracer.setConfig 设置了 sampleRate < 1
  • 采集到 RUM 数据不全,没有 Resource 或 Action 数据?

    Resource 和 Action 数据是与 View 进行绑定的,需要确保有 startView 操作,可参考 RUM-View 文档来实现 View 事件采集。

  • 排查上传数据设备网络与安装 datakit 设备网路与负载问题。

更多阅读

文档评价

文档内容是否对您有帮助? ×