Skip to content

Troubleshooting

SDK Initialization Errors

Regular uni-app

  1. Confirm that both GC-JSPlugin and GC-UniPlugin are version 0.3.0 or later, with identical version numbers from the same release package.
  2. Verify that the app entry has loaded GC-UniPlugin/setup.js before the first use of the JS collector.
  3. Ensure that the SDK API is imported from GC-UniPlugin and the JS collector is imported from GC-JSPlugin.
  4. Verify that the project does not contain an old nativeplugins/GCUniPlugin and its corresponding manifest.json configuration.
  5. Confirm that the datakitUrl or datawayUrl + clientToken configuration is valid.

uni Mini Program

  1. For uni mini program projects, install only GC-JSPlugin; do not import GC-UniPlugin or setup.js.
  2. The Host App must initialize the Native SDK before opening the uni mini program.
  3. The Host App has registered GCUniPlugin-MobileAgent, GCUniPlugin-RUM, GCUniPlugin-Logger, and GCUniPlugin-Tracer.
  4. When the regular debug base lacks host modules, the public API safely degrades to no-op, so native data will not be reported. Perform integration testing in a real Host App.

Enable Debug Mode

Regular uni-app:

import { mobileAgent } from '@/uni_modules/GC-UniPlugin';

mobileAgent.sdkConfig({
    datakitUrl: 'YOUR_DATAKIT_URL',
    debug: true
});

For uni mini programs, the Host App enables the Native SDK Debug configuration; do not call sdkConfig() again on the JS side.

It is recommended to disable Debug mode before releasing the official version.

View logs with the [FT-SDK] tag prefix in Logcat.

Check SDK debug logs containing [FTLog] in the macOS Console app.

Check SDK debug logs with [FT-SDK] in the DevEco Studio log window.

SDK Runs Normally but No Data

  • Troubleshoot Datakit to confirm it is running correctly.
  • Verify that the SDK upload address configuration is correct, and check the sync results in Debug logs.
  • Confirm that the RUM initialization uses the App ID corresponding to the current platform.
  • Ensure that the current network can reach the DataKit or DataWay.
  • For uni mini program scenarios, confirm that the Host App initialization is complete before opening the uni mini program.

Data Loss

  • Check whether sampleRate < 1 is configured in RUM, Log, or Trace.
  • Resources and Actions must be associated with a valid View. Confirm that startView is called automatically or manually.
  • When enableNativeUserResource is enabled on iOS, set gcResourceTracking.startTracking({ enableIOS: false }) to avoid duplicate collection of the same request.
  • Do not enable both gcViewTracking and the legacy View mixin simultaneously to collect the same page.
  • Check device network, DataKit load, and local cache limits.

Feedback

Is this page helpful?