Back to Skiasharp

Troubleshooting Guide

.agents/skills/release-testing/references/troubleshooting.md

3.119.46.7 KB
Original Source

Troubleshooting Guide

Quick reference for common errors and fixes.

Package Resolution Errors

Packages appear missing but CI succeeded

Symptom: CI shows success, but package search seems to find wrong version or nothing matching your release.

Cause: Using .latestVersion from the JSON instead of .version. The feed contains multiple version streams (e.g., 3.119.2 AND 3.119.3), so .latestVersion returns the wrong one.

Fix: Use .version and filter by base version + label from the release branch:

bash
dotnet package search SkiaSharp \
  --source "https://aka.ms/skiasharp-eap/index.json" \
  --exact-match --prerelease --format json \
  | jq -r '.searchResult[].packages[] | select(.id == "SkiaSharp") | .version' \
  | grep "^3.119.2-preview.3\."
❌ Wrong✅ Correct
.latestVersion.version
No filteringFilter by {base}-{label}.*

Build Errors

ErrorCauseFix
MAUI workload is requiredMissing workloaddotnet workload install maui
wasm-tools workload is requiredMissing workloaddotnet workload install wasm-tools
SkiaSharpVersion must be specifiedMissing version paramAdd -p:SkiaSharpVersion=X.Y.Z -p:HarfBuzzSharpVersion=X.Y.Z.N

Appium Errors

ErrorCauseFix
Cannot start process 'appium'Appium not installednpm install -g appium
Mac2 driver requires CarthageCarthage missingbrew install carthage
Connection refusedPort conflictAppium auto-starts on 4723; check for conflicts
Session creation timeoutFirst run building WDAWait - WebDriverAgent builds on first iOS/Mac run
Invalid bundle identifierWrong bundleIdTests extract from csproj automatically

Simulator/Emulator Errors

ErrorCauseFix
No Android devices foundNo emulator runningStart emulator first
Simulator not foundWrong device nameCheck xcrun simctl list devices available
iOS version not availableMissing runtimeInstall via Xcode → Platforms
System UI isn't responding (Android)Emulator unstableTests auto-retry with dialog dismissal

Android Crash Diagnostics

Getting Crash Details

bash
# Check if app crashed
adb logcat -d | grep -E "(Force removing|app died)" | tail -5

# Get stack trace
adb logcat -d | grep -E "(AndroidRuntime|FATAL EXCEPTION)" -A15 | head -30

Common Crash Causes

Log MessageMeaningAction
Force removing...app diedApp crashedGet stack trace, investigate
Killing...stop <package>Normal force-stopExpected after test completes
FATAL EXCEPTIONUnhandled exceptionBug - investigate
Native crashNative library issueBug - investigate

Old Android (API 21-23) Crashes

Old Android may crash due to:

  • Missing APIs that MAUI expects
  • Different permission behavior
  • Slower startup causing timeouts

If crash only on old Android: get full stack trace, check if known MAUI/SkiaSharp issue.

iOS Diagnostics

Simulator Logs

bash
xcrun simctl list devices booted  # get UDID
xcrun simctl spawn <UDID> log stream --predicate 'process == "YourApp"'

Or use Console.app → select simulator device.

Common iOS Issues

SymptomCauseFix
Simulator won't bootCorrupt statexcrun simctl erase <UDID>
App won't installCode signingCheck Appium logs
Black screenApp crashedCheck simulator logs

Screenshot Errors

ErrorCauseFix
Image similarity too lowRendering mismatchINVESTIGATE - potential real bug
Screenshot is blank/blackRendering failedINVESTIGATE - potential real bug
Failed to decode imageCorrupt screenshotCheck Appium logs for errors
Resizing actual to match expectedSize mismatchNormal for different devices - comparison still works

Playwright Errors

ErrorCauseFix
Executable doesn't existBrowsers not installedpwsh playwright.ps1 install chromium
Target page, context or browser has been closedServer crashedCheck app build output
Timeout waiting for selectorApp didn't renderCheck Blazor app console for errors
Blazor server failed to startEnv vars from parentFixed in test code (ClearDotNetEnvironmentVariables)

Docker Errors (Linux Console Tests)

ErrorCauseFix
Docker is not availableDocker not installed/runningInstall Docker Desktop, start it
undefined symbol: uuid_generate_randomUsing NativeAssets.Linux instead of NoDependenciesUse SkiaSharp.NativeAssets.Linux.NoDependencies
Fontconfig error: Cannot load default config fileNo fontconfig in containerExpected with NoDependencies — not an error
Cannot connect to the Docker daemonDocker Desktop not runningStart Docker Desktop
Docker image build slowNo layer cacheNormal on first run (~90s), cached after

Platform-Specific Notes

If Blazor tests fail with path-related errors, the test infrastructure automatically resolves /var/private/var in PlatformTestBase.cs.

iOS Simulator Scale Factors

Scale factor calculated automatically from screenshot size vs window size:

  • iPhone Pro/Max: 3x
  • iPhone standard: 3x
  • iPad: 2x

Mac Catalyst

Mac Catalyst uses hardcoded 2x scale factor. Screenshot is full monitor size, element coordinates are app-relative.

"Timed out while enabling automation mode" error:

This is a macOS accessibility permissions issue. The WebDriverAgentMac process needs accessibility permissions to automate apps.

Fixes to try (in order):

  1. Reset accessibility permissions: tccutil reset Accessibility
  2. System Settings → Privacy & Security → Accessibility → Add Terminal.app (or your IDE)
  3. Restart Terminal/IDE after granting permissions
  4. If still failing, try running test in isolation (not after other tests)

The test includes retry logic (3 attempts) with recovery actions that reset TCC and kill stale processes. If it still fails after retries, it's likely a deeper macOS configuration issue.

Retry Logic

Tests include automatic retry for transient failures:

  • Android: 3 retries, 10s delay, recovery includes dialog dismissal
  • iOS: 3 retries, 10s delay
  • Mac Catalyst: 3 retries, 30s delay, recovery includes TCC reset and process cleanup
  • Blazor: 3 retries for server startup

Retryable errors include:

  • Device not found
  • Driver crashed
  • Connection refused
  • Session creation failed
  • Element not found (might be blocked by dialog)