# Execution failed for task ':app:compileDebugKotlin'. > 'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.

- **ID:** `android/compile-sdk-version-mismatch`
- **Domain:** android
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

Mismatch between Java and Kotlin JVM target versions in build.gradle, causing compilation incompatibility.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Kotlin 1.8.0 | active | — | — |
| Android Gradle Plugin 8.0.0 | active | — | — |
| Java 11 | active | — | — |

## Workarounds

1. **In build.gradle (app level), set both targets: android { compileOptions { sourceCompatibility JavaVersion.VERSION_11; targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = '11' } }** (95% success)
   ```
   In build.gradle (app level), set both targets: android { compileOptions { sourceCompatibility JavaVersion.VERSION_11; targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = '11' } }
   ```
2. **If using Java 8, align both to 8: kotlinOptions { jvmTarget = '1.8' } and compileOptions { sourceCompatibility JavaVersion.VERSION_1_8; targetCompatibility JavaVersion.VERSION_1_8 }** (90% success)
   ```
   If using Java 8, align both to 8: kotlinOptions { jvmTarget = '1.8' } and compileOptions { sourceCompatibility JavaVersion.VERSION_1_8; targetCompatibility JavaVersion.VERSION_1_8 }
   ```

## Dead Ends

- **Only changing compileSdk version in build.gradle without adjusting Java/Kotlin targets** — compileSdk is separate from JVM target; does not resolve version mismatch error. (95% fail)
- **Setting both Java and Kotlin targets to 1.6 (deprecated) in hope of backward compatibility** — AGP 8.0+ requires minimum Java 8; 1.6 is unsupported and causes other errors. (85% fail)
