This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Android Crash & ANR Detection Library built with Kotlin. This is a library module (not an app) that automatically detects and logs crashes and ANRs with detailed stack traces.
- Package:
io.kseongbin.crashwatcher - Version: 1.0.0
- Min SDK: API 26 (Android 8.0 Oreo)
- Target SDK: API 36
- Java: Version 17
- Kotlin: 2.0.21
- AGP: 8.12.3
Gradle Version Catalog: Dependencies are managed via gradle/libs.versions.toml.
Build Library (AAR):
# Build both debug and release AAR
./gradlew clean build
# Build release AAR only
./gradlew assembleRelease
# Build debug AAR only
./gradlew assembleDebugOutput: app/build/outputs/aar/
crashwatcher-debug-1.0.0.aarcrashwatcher-release-1.0.0.aar
Run all tests:
./gradlew testRun unit tests:
./gradlew testDebugUnitTestRun instrumented tests (requires connected device/emulator):
./gradlew connectedAndroidTestLint checks:
./gradlew lintio.kseongbin.crashwatcher/
├── CrashLogger.kt # Main entry point
├── CrashLoggerConfig.kt # Configuration options
├── internal/
│ ├── CrashDetector.kt # UncaughtExceptionHandler
│ ├── AnrDetector.kt # Watchdog for ANR detection
│ ├── LogWriter.kt # File I/O operations
│ ├── LogFormatter.kt # Log formatting
│ └── DeviceInfoCollector.kt # Device metadata collection
└── model/
├── CrashInfo.kt
├── AnrInfo.kt
├── DeviceInfo.kt
└── AppInfo.kt
- Runtime On/Off Control:
CrashLogger.setEnabled(true/false) - BuildConfig Integration: Auto-disable in release builds
- No Permissions Required: Uses
getExternalFilesDir() - Thread-Safe: Synchronized logging operations
- ProGuard Rules: Auto-applied via
consumer-rules.pro
Library does NOT minify (minifyEnabled = false) - user apps handle minification.
Consumer ProGuard Rules (app/consumer-rules.pro):
- Automatically applied to apps using this library
- Preserves public API and stack trace information
- No manual configuration needed by library users
Update version in app/build.gradle.kts:
defaultConfig {
version = "1.0.0" // Update here
}AAR filename will automatically update to crashwatcher-{buildType}-{version}.aar
- main branch is protected
- Pull requests required for collaborators
- Owner can bypass (for convenience)
README.md- English documentationREADME_KR.md- Korean documentation- Both include usage examples, API reference, and configuration options