Debugging guide for Android Kotlin and Jetpack Compose development.
Install
mkdir -p .claude/skills/debug-woliveiras && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10732" && unzip -o skill.zip -d .claude/skills/debug-woliveiras && rm skill.zipInstalls to .claude/skills/debug-woliveiras
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Debugging workflow for the Android (Kotlin + Jetpack Compose) app. Use when tracking down runtime errors, unexpected behavior, network issues, or state problems. Trigger phrases: "debug", "não está funcionando", "erro em runtime", "por que isso falha", "breakpoint", "/debug".Key capabilities
- →Analyze logcat
- →Inspect layout trees
- →Profile network requests
- →Diagnose runtime crashes
How it works
It provides a structured workflow for diagnosing Android issues using standard tools like Logcat, Layout Inspector, and Profilers.
Inputs & outputs
When to use debug
- →Debugging runtime crashes
- →Inspecting ui trees
- →Debugging network request issues
- →Investigating state management problems
About this skill
Debugging — Android / Jetpack Compose
Tools available
| Tool | What it debugs |
|---|---|
Logcat (adb logcat) | Runtime logs, crashes, ANRs |
| Android Studio Debugger | Breakpoints, step-through, evaluate |
| Layout Inspector | Compose tree, recomposition counts |
| Network Profiler | OkHttp requests/responses |
./gradlew test --info | Unit test failures with stack traces |
Step-by-step workflow
1. Identify the layer
| Symptom | Likely layer | Start here |
|---|---|---|
| Compilation error | Kotlin / Gradle | ./gradlew compileDebugKotlin 2>&1 | grep "^e:" |
| Test failure | Unit logic | ./gradlew test --tests "ClassName" --info |
| Crash on startup | Hilt / Activity | Logcat for FATAL EXCEPTION |
| Wrong data shown | Repository / API | ArxivApiServiceImpl.kt, repository layer |
| State not updating | ViewModel | StateFlow emissions, check viewModelScope |
| Navigation broken | NavHost | MainActivity.kt routes |
| PDF not opening | Intent / FileProvider | DetailViewModel.kt download logic |
| DataStore lost | Persistence | SettingsDataStore.kt |
2. Check Logcat first
adb logcat -s "paperstack" "*:E" # errors only
adb logcat | grep -E "FATAL|Exception|Error"
Or filter by package:
adb logcat --pid=$(adb shell pidof com.paperstack)
3. Inspect network (arXiv API)
Add temporary logging in ArxivApiServiceImpl.kt:
Log.d("ArxivApi", "request: $url")
Log.d("ArxivApi", "response code: ${response.code}")
Log.d("ArxivApi", "body: ${response.body?.string()}") // remove after debug
Never commit Log.d calls — remove before PR.
4. Inspect ViewModel state
Add temporary logging in the ViewModel:
Log.d("FeedVM", "state: ${_state.value}")
Or use the debugger: set a breakpoint in the ViewModel and inspect _state.value.
5. Isolate with a unit test
If the bug is in a service or repository, write a failing test:
./gradlew test --tests "com.paperstack.data.remote.ArxivApiServiceImplTest" --info
This is often faster than running the full app.
6. XML parsing issues
If the arXiv response parses incorrectly:
- Log the raw XML (step 3)
- Create a test fixture in the test class
- Run
parseResponse()against it with MockWebServer - Adjust
XmlPullParserlogic — do NOT switch to regex parsing
7. Hilt / DI issues
| Issue | Fix |
|---|---|
UninitializedPropertyAccessException | Missing @Inject or @HiltViewModel |
MissingBinding | Check @Module / @Provides in di/ |
Kotlin metadata unsupported | Clean build: ./gradlew clean assembleDebug |
| Hilt compilation error | Verify KSP + Hilt versions are compatible |
8. Compose-specific
| Issue | Fix |
|---|---|
| Recomposition loop | Check mutable state reads in composables |
@OptIn required | Add @OptIn(ExperimentalMaterial3Api::class) |
| Unresolved reference | Verify import + dependency in build.gradle.kts |
| Preview crash | Ensure @Preview composable has no Hilt deps |
Anti-patterns
- ❌ Leaving
Log.din committed code - ❌ Using
!!to silence nullability — fix the null check - ❌ Suppressing lint warnings to work around a bug
- ❌ Debugging state by reading DataStore directly — use ViewModel StateFlow
- ❌ Guessing at XML structure — always log the raw response first
When not to use it
- →Non-Android development
Prerequisites
Limitations
- →Requires physical or virtual device
How it compares
It is specifically optimized for Kotlin and Jetpack Compose development patterns.
Compared to similar skills
debug side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| debug (this skill) | 0 | 3mo | Review | Intermediate |
| android-kotlin-development | 268 | 5mo | Review | Advanced |
| kotlin-multiplatform | 32 | 3mo | Review | Advanced |
| android-kotlin | 7 | 4mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
android-kotlin-development
aj-geddes
Develop native Android apps with Kotlin. Covers MVVM with Jetpack, Compose for modern UI, Retrofit for API calls, Room for local storage, and navigation architecture.
kotlin-multiplatform
vitorpamplona
Platform abstraction decision-making for Amethyst KMP project. Guides when to abstract vs keep platform-specific, source set placement (commonMain, jvmAndroid, platform-specific), expect/actual patterns. Covers primary targets (Android, JVM/Desktop, iOS) with web/wasm future considerations. Integrates with gradle-expert for dependency issues. Triggers on: abstraction decisions ("should I share this?"), source set placement questions, expect/actual creation, build.gradle.kts work, incorrect placement detection, KMP dependency suggestions.
android-kotlin
alinaqi
Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing
testing-android-code
bitwarden
This skill should be used when writing or reviewing tests for Android code in Bitwarden. Triggered by "BaseViewModelTest", "BitwardenComposeTest", "BaseServiceTest", "stateEventFlow", "bufferedMutableSharedFlow", "FakeDispatcherManager", "expectNoEvents", "assertCoroutineThrows", "createMockCipher", "createMockSend", "asSuccess", "Why is my Bitwarden test failing?", or testing questions about ViewModels, repositories, Compose screens, or data sources in Bitwarden.
gradle-expert
vitorpamplona
Build optimization, dependency resolution, and multi-module KMP troubleshooting for AmethystMultiplatform. Use when working with: (1) Gradle build files (build.gradle.kts, settings.gradle), (2) Version catalog (libs.versions.toml), (3) Build errors and dependency conflicts, (4) Module dependencies and source sets, (5) Desktop packaging (DMG/MSI/DEB), (6) Build performance optimization, (7) Proguard/R8 configuration, (8) Common KMP + Android Gradle issues (Compose conflicts, secp256k1 JNI variants, source set problems).
reviewing-changes
bitwarden
Guides Android code reviews with type-specific checklists and MVVM/Compose pattern validation. Use when reviewing Android PRs, pull requests, diffs, or local changes involving Kotlin, ViewModel, Composable, Repository, or Gradle files. Triggered by "review PR", "review changes", "check this code", "Android review", or code review requests mentioning bitwarden/android. Loads specialized checklists for feature additions, bug fixes, UI refinements, refactoring, dependency updates, and infrastructure changes.