Troubleshooting¶
No Data After Initialization¶
Check the following in order:
- You must use a native Android or iOS build. Browser preview and web builds do not report data.
- Confirm you have run
npx --no-install truewatch-cocos install --project ., then reopen Cocos Creator and enable thetruewatch-cocos-sdkextension. - After upgrading or reinstalling the npm package, you must regenerate the native project.
- Confirm that
datakitUrl, ordatawayUrltogether withclientToken, is configured correctly. - Android must provide
androidAppId, and iOS must provideiosAppId. - Set
debug: trueduring initialization and check Cocos and native logs. - Confirm that
sampleRateis not0. - If you are using a local deployment, continue troubleshooting with DataKit No Data Issue.
Installer Cannot Find the Cocos Project¶
If you see:
--project must point to the root directory of a Cocos project that contains the assets directory:
Wrong Creator Entry Point¶
Creator 2 and Creator 3 use the same @truewatchtech/cocos-sdk npm package, but their import entry points differ:
- Creator 2:
@truewatchtech/cocos-sdk/creator2 - Creator 3:
@truewatchtech/cocos-sdk/creator3
After changing the import entry point, rerun the installer and regenerate the native project. If the installer cannot identify the Creator version, pass --creator 2 or --creator 3 explicitly.
Android Bridge or Dependency Errors¶
When ClassNotFoundException occurs, FTCocosBridge cannot be found, or native SDK classes are missing:
- Confirm the generated project contains
cocos-sdk-native/android. - Check whether the app module's
build.gradlecontains theCOCOS_SDK_BEGINmarker block. - Confirm Gradle can access
https://mvnrepo.truewatch.com/repository/maven-releases. - Confirm AndroidX is enabled.
- Confirm the Compile SDK and Build Tools are at least 34, and the Min SDK is at least 21.
- Rerun the installer and regenerate the project. Do not reuse the old native project.
iOS Bridge or CocoaPods Errors¶
The following checks apply to projects that use CocoaPods:
- Confirm the generated project contains
cocos-sdk-native/ios. - Confirm that
pod 'FTCocosBridge'exists in thePodfile. - Run
pod installagain in the directory containing thePodfile. - Use
.xcworkspace, not.xcodeproj. - Clean the Xcode Build Folder and rebuild.
For Creator 2 projects, the minimum iOS version is raised to 12.0. Xcode 15-compatible linker flags are automatically written into the generated configuration by the build extension.
RUM Available but No View¶
- Enable
autoTrack.scenes: true; or - Call
truewatchSdk.rum.startView()when entering a business scene, and callstopView()when leaving it.
If initialization happens after the first scene has started, scene events may be missed. Initialize before the first scene to be tracked.
Automatic Actions or Errors Do Not Take Effect¶
Action:
- Confirm
autoTrack.actions: true; - Confirm that the interaction ultimately triggers the global
TOUCH_END; - Custom input systems or components that swallow global events must call the Action API manually.
Error:
- Confirm
autoTrack.errors: true; - The current runtime must provide a global
addEventListener; - Exceptions already caught by business
try/catchcode must calladdError()manually.
Log Has No Data or No RUM Association¶
- Initialize
loggerand setenableCustomLog: true. - Check
sampleRateandlogLevelFilters. - Console collection also requires
autoTrack.console: true. - RUM association requires
enableLinkRumData: true, a valid RUM Session, and a current View. - Logs produced before the first View may not be associated with a View.
Trace Header Is Empty¶
- Confirm that
traceis initialized. - The URL must not be empty and must be a valid URL that the native SDK can handle.
- Check the Trace sample rate.
- Unsupported platforms return an empty object.
- Automatic injection only covers the
fetchandXMLHttpRequestprovided by the runtime.
Duplicate Network Data¶
Check whether any of the following are enabled at the same time:
autoTrack.networkandenableNativeUserResource;autoTrack.networkandenableNativeAutoTrace;- Automatic network collection and manual business Resource/Trace.
Keep only one collection path for the same request stack, then compare the RUM Resource count with the request headers.
Session Replay Has No Frames¶
- Confirm that RUM is initialized and a valid View currently exists.
- Confirm that there is a Camera in the scene, or call
setReplayCamera(). - Confirm that the Replay and RUM sample rates are not
0. - Static frames are treated as duplicate frames and are skipped.
- Check the console for capture-stop errors.
- Check the Session Replay native dependencies against the current SDK version combinations, then regenerate and compile the native project.
Initialization Parameters Throw Exceptions¶
| Error | Cause |
|---|---|
Configure datakitUrl or datawayUrl with clientToken |
No valid reporting address is configured |
... must be between 0 and 1 |
The RUM, Log, Trace, or Replay sample rate is out of range |
captureFps must be an integer between 1 and 5 |
Replay FPS is not an integer in the range 1–5 |
maxImageDimension must be between 1 and 2048 |
The longest Replay edge is out of range |
... must not be empty |
Required strings such as View, Action, Resource Key, or Trace URL are empty |
Performance Issues¶
- Start Session Replay with
captureFps: 1andmaxImageDimension: 720. - Disable automatic Console collection when it is not needed.
- Avoid passing large objects in logs and event attributes.
- Enable only the native monitoring metrics you need.
- Check for duplicate network collection.
No Collection After Shutting Down the SDK¶
truewatchSdk.shutdown() removes automatic listeners, stops Session Replay, and shuts down the native SDK. Do not continue calling collection methods after shutdown. If you need to re-enable the SDK, restart the application and complete initialization.