The error "org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed" usually occurs due to Groovy/Gradle script issues or JDK incompatibility. In my case, the problem was caused by Android Studio’s default JDK. Solution: Change JDK to a Locally Installed Version Open Android Studio. Go to File → Settings → Build, Execution, Deployment → Build Tools → Gradle. Under Gradle JDK, change the selection from the default Embedded JDK to your locally installed JDK. Click Apply and OK, then restart Android Studio. Sync Gradle again: File → Sync Project with Gradle Files. Why Does This Happen? The default JDK bundled with Android Studio might not be fully compatible with the Gradle version. Some third-party libraries require a specific JDK version to compile successfully. Gradle might be referencing an older or incompatible JDK, causing Groovy compilation issues. Alternative Fixes: If changing the JDK doesn't work, try:
Upgrading Gradle: Update gradle-wrapper.properties to a newer Gradle version. Deleting .gradle and .idea folders and then syncing again. Running Gradle from the command line for more details:enter image description here ./gradlew clean ./gradlew build --stacktrace Gradle Setting