Skip to content

Troubleshooting

Enable Debug Mode

You can enable the SDK's Debug feature through the following configuration. After enabling, on Android systems, you can directly view the output Debug logs in the Flutter compilation tool. For iOS, you need to compile and run through Xcode, compile with Xcode, or view them through the MacOS Console application.

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

Note: It is recommended to disable this configuration when releasing the Release version.

Android Logcat and iOS Xcode Console log samples

SDK Runs Normally But No Data

  • Check if Datakit is running normally.

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

  • Check if datakit is uploading data to the corresponding workspace and if it is offline. This can be confirmed by logging into TrueWatch and checking the "Infrastructure".

Pod Errors During Compilation

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 similar version import issue when compiling the iOS application, you need to execute the following command in the terminal within the ios folder of your 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!, executing pod install will trigger 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 OC library FTMobileSDK. Because the FTMobileSDK.podspec lacks the DEFINES_MODULE = YES configuration, it causes a "module not found" error during iOS static library compilation.

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 is only a supplement to the compilation configuration and does not duplicate the SDK import.

Data Loss

Partial Data Loss

  • If some data from a specific RUM Session or a few pieces of data from Log or Trace are missing, first exclude whether sampleRate < 1 is set in FTRUMManager.setConfig, FTLogger.logConfig, or FTTracer.setConfig.
  • Is the collected RUM data incomplete, missing Resource or Action data?

    Resource and Action data are bound to Views. Ensure there is a startView operation. Refer to the RUM View documentation to implement View event collection.

  • Investigate network issues on the device uploading data and network/load issues on the device where datakit is installed.

Further Reading