Skip to content

Troubleshooting

Enable Debug Mode

You can enable the SDK's Debug feature with the following configuration. Once enabled, on Android, you can view the output Debug logs directly in the Flutter build tools. On iOS, you need to build and run through Xcode, build with Xcode, or view them through the macOS Console app.

FTMobileFlutter.sdkConfig(
      datakitUrl: serverUrl,
      debug: true, // Enable debug mode
  );

Note: It is recommended to disable this configuration when publishing a Release version.

Android Logcat and iOS Xcode Console log examples

SDK Is Running Normally but No Data

  • Troubleshoot Datakit to check whether it is running normally

  • Confirm that the SDK upload address datakitUrl or datawayUrl is configured correctly and properly initialized. In debug mode, check the sync logs in Android Logcat or iOS Xcode Console.

  • Check whether DataKit is uploading data to the corresponding Workspace and whether it is offline. You can confirm this by logging in to TrueWatch and viewing "Infrastructure".

Pod Errors During Compilation

Starting from SDK 0.5.8, the iOS native dependency has changed to TrueWatchSDK, and the minimum iOS version is 15.0. When upgrading, synchronize the compatible versions of Core and Replay, the Deployment Target, and the dependency lock file to avoid linking the old FTMobileSDK at the same time. For integration steps, see iOS Integration. The following FTMobileSDK error examples apply to older dependency versions.

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.

If you encounter a version import issue like this when compiling an iOS application, run the following command in a terminal in the ios directory of the Flutter project:

pod install --repo-update

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

In ft_mobile_agent_flutter ≤ 0.5.6, if the CocoaPods configuration does not explicitly specify use_module_headers! or use_frameworks!, running pod install triggers the following error:

[!] 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.

Cause: ft_mobile_agent_flutter (developed in Swift) depends on the Objective-C library FTMobileSDK. Because FTMobileSDK.podspec lacks the DEFINES_MODULE = YES configuration, the iOS static library compilation reports that the module cannot be found.

Solution: Add the following configuration inside the target 'Runner' do block in your project's Podfile:

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

Note: Adding :modular_headers => true only supplements the build configuration; it does not introduce the SDK again.

Data Loss

Partial Data Loss

  • If data for a particular RUM Session is lost, or a few Log or Trace records are lost, first check the sampling configuration for RUM, Log, and Trace. Starting from SDK 0.5.8, the recommended percentage fields are sessionSamplingRate, logSamplingRate, and traceSamplingRate; values less than 100 enable proportional sampling. The old sampleRate still uses a probability in the [0,1] range. The new fields take precedence over the old ones. Also check whether remote configuration overrides local values.
  • Is the collected RUM data incomplete, with no Resource or Action data?

    Resource and Action data are bound to a View. Make sure to start the View through FTRouteObserver or manually with starView. See the RUM View documentation to implement View event collection.

  • Troubleshoot network issues on the data-uploading device and network and load issues on the device where DataKit is installed.

Further Reading