Troubleshooting¶
SDK Initialization Errors¶
Regular uni-app¶
- Confirm that both
GC-JSPluginandGC-UniPluginare version0.3.0or later, with identical version numbers from the same release package. - Verify that the app entry has loaded
GC-UniPlugin/setup.jsbefore the first use of the JS collector. - Ensure that the SDK API is imported from
GC-UniPluginand the JS collector is imported fromGC-JSPlugin. - Verify that the project does not contain an old
nativeplugins/GCUniPluginand its correspondingmanifest.jsonconfiguration. - Confirm that the
datakitUrlordatawayUrl + clientTokenconfiguration is valid.
uni Mini Program¶
- For uni mini program projects, install only
GC-JSPlugin; do not importGC-UniPluginorsetup.js. - The Host App must initialize the Native SDK before opening the uni mini program.
- The Host App has registered
GCUniPlugin-MobileAgent,GCUniPlugin-RUM,GCUniPlugin-Logger, andGCUniPlugin-Tracer. - 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 < 1is configured in RUM, Log, or Trace. - Resources and Actions must be associated with a valid View. Confirm that
startViewis called automatically or manually. - When
enableNativeUserResourceis enabled on iOS, setgcResourceTracking.startTracking({ enableIOS: false })to avoid duplicate collection of the same request. - Do not enable both
gcViewTrackingand the legacy View mixin simultaneously to collect the same page. - Check device network, DataKit load, and local cache limits.