Skip to content

Troubleshooting

SDK Initialization Exception Check

Check Logcat to confirm if there are logs with Level as Error and Tag prefixed with [FT-SDK].

14:46:04.825 [FT-SDK] com.demo E Please install the SDK first (call FTSdk.install(FTSDKConfig ftSdkConfig) when the application starts)

The SDK internally uses assertions to check the correctness of multiple configurations. When configurations are incorrect, the program will crash and output relevant warnings. However, by default, this only takes effect in the Debug environment. It is recommended to use the offline packaging project to create a custom debugging base and set it to also take effect in the Release environment.

Click project -> target -> Build Settings, search for ENABLE_NS_ASSERTIONS in the search box, and change the Release setting to Yes.

uniapp_ios_assert

It is recommended to configure this only in the debugging base. Use the default configuration for normal packaging and distribution.

If the above configuration is not performed, you can also enable Debug debugging and check the debug logs in the 「Console」 to determine whether the SDK initialization was successful.

Enable Debug Debugging

You can enable the SDK's debug function through the following configuration.

    var ftMobileSDK = uni.requireNativePlugin("GCUniPlugin-MobileAgent");
  ftMobileSDK.sdkConfig({
                'serverUrl': SDKConst.SERVER_URL,
                'debug': true,
            });

It is recommended to turn off this configuration when releasing the version.

Check the logs in Logcat with Tag prefixed with [FT-SDK].

Check the SDK debug logs in the 「Console」 on Mac.

「Console」 usage:

Select Action, check Include Summary Information, Include Debug Information.

Select the debugging device, click the Start button, and enter the search condition [FTLog] in the search condition box on the right. You can now view the SDK's debug logs.

console_app_use

Android Logcat and iOS Xcode Console log examples.

SDK Runs Normally but No Data

  • Check if Datakit is running normally.

  • Confirm that the SDK upload address serverUrl is configured correctly and initialized correctly. In debug mode, check the synchronization 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」.

Data Loss

Partial Data Loss

  • If some data from a RUM Session or a few pieces of data from Log or Trace are missing, first exclude whether samplerate < 1 is set in the RUM configuration, Log configuration, or Trace configuration.

  • 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.