79137002

Date: 2024-10-29 11:31:07
Score: 0.5
Natty:
Report link

First of all Unknown Kotlin JVM target: 21 itself says that current set target jvm is 21.

Reason: After updating android studio sometimes sets default jvm target automatically without informing / prompting and that causes the confusion.

Steps

  1. Go to settings in android studio and select Gradle under Build, Execution, Deployment Menu as it is visible in screenshot below.

enter image description here

  1. Change default jvm target to JetBrains JDK 17.0.12

enter image description here

  1. Delete .gradle generated directory / folder from the project explorer in android studio.

enter image description here

  1. Optionally gradle command can also be used ./gradlew clean build

  2. Run sync project with gradle

  3. Rebuild the project from Build -> Rebuild project

It starts working.

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Vikash Kumar Tiwari