Skip to main content
LCK operations return error codes to indicate success or failure. Always check return values and handle errors appropriately.

ELCKError Enum

NameValueDescription
None0Operation completed successfully
InvalidTrackingId1Tracking ID is missing or not in UUID v4 format
RecordingAlreadyStarted2Cannot start recording - already in progress
NotCurrentlyRecording3Cannot stop recording - not currently recording
EncoderNotAvailable4Platform encoder not found or failed to initialize
InsufficientStorage5Not enough disk space for recording
PermissionDenied6Microphone or storage permission was denied
EncodingError7Error occurred during video/audio encoding
TextureError8Failed to capture or process render texture
AudioError9Audio capture or mixing error
SaveError10Failed to save recording to disk
InvalidState11Operation not valid in current state
UENUM(BlueprintType)
enum class ELCKError : uint8
{
    None = 0,
    InvalidTrackingId,
    RecordingAlreadyStarted,
    NotCurrentlyRecording,
    EncoderNotAvailable,
    InsufficientStorage,
    PermissionDenied,
    EncodingError,
    TextureError,
    AudioError,
    SaveError,
    InvalidState
};

Error Handling Patterns

Basic Error Check

bool bSuccess = Service->StartRecording();
if (!bSuccess)
{
    UE_LOG(LogLCK, Error, TEXT("Failed to start recording"));
}

Async Error Handling

Service->StartRecordingAsync(FOnLCKRecorderBoolResult::CreateLambda([](bool bSuccess)
{
    if (bSuccess)
    {
        UE_LOG(LogLCK, Log, TEXT("Recording started successfully"));
    }
    else
    {
        UE_LOG(LogLCK, Error, TEXT("Failed to start recording"));
        // Show error notification to user
    }
}));

Validation Before Recording

// Check prerequisites before starting
ULCKDeveloperSettings* Settings = ULCKDeveloperSettings::Get();

if (!Settings->IsTrackingIdValid())
{
    UE_LOG(LogLCK, Error, TEXT("Invalid Tracking ID - recording disabled"));
    return;
}

FLCKAudioConfigValidation Validation = Settings->ValidateAudioConfig();
if (!Validation.bIsValid)
{
    for (const FString& Warning : Validation.Warnings)
    {
        UE_LOG(LogLCK, Warning, TEXT("%s"), *Warning);
    }
}

// Proceed with recording
Service->StartRecording();

Common Error Scenarios

Cause: The Tracking ID in Project Settings is empty or not in valid UUID v4 format.Solution:
  1. Get your Tracking ID from the LCK Dashboard
  2. Go to Project Settings > Plugins > LCK SDK
  3. Enter the Tracking ID in the format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
Validation Code:
if (!ULCKDeveloperSettings::Get()->IsTrackingIdValid())
{
    // Handle invalid tracking ID
}
Cause: Attempted to start recording while already recording.Solution: Check recording state before starting:
if (!Service->IsRecording())
{
    Service->StartRecording();
}
Cause: Platform-specific encoder failed to initialize.Common Reasons:
  • Windows: Media Foundation not available
  • Android: Hardware encoder not supported
  • Vulkan interop failed
Solution:
  1. Verify platform requirements are met
  2. Check LogLCKEncoding for detailed errors
  3. Ensure GPU supports H.264 encoding
Cause: Not enough free disk space for recording.Solution:
  1. Check available storage before recording
  2. Clear old recordings
  3. Reduce quality profile to decrease file size
Check Storage:
int64 FreeSpace = FPlatformMisc::GetDiskFreeSpace();
if (FreeSpace < MinRequiredSpace)
{
    // Show low storage warning
}
Cause: User denied microphone or storage permission on Android.Solution:
  1. Request permissions before using LCK features
  2. Handle permission denial gracefully
  3. Show explanation to user why permissions are needed
Android Permissions Required:
  • RECORD_AUDIO - for microphone capture
  • WRITE_EXTERNAL_STORAGE - for saving recordings (API < 29)

Error Logging

LCK uses Unreal’s logging system with these categories:
CategoryDescription
LogLCKGeneral SDK operations
LogLCKEncodingVideo/audio encoding
LogLCKAudioAudio capture and mixing
LogLCKUIUI component operations
LogLCKTabletTablet-specific operations
Enable verbose logging for debugging:
; DefaultEngine.ini
[Core.Log]
LogLCK=VeryVerbose
LogLCKEncoding=VeryVerbose

See Also