Android Execution failed compileDebugJavaWithJavac

I tried to review a CV maker mobile application and concluded that Android Studio was outdated on my laptop. It was throwing very strange error messages, and online advice suggested downgrading Java. Do not do this; simply update Android Studio and perform a Gradle upgrade, and everything will be resolved.

 

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':share_plus:compileDebugJavaWithJavac'.
> error: invalid source release: 17

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 9s
Running Gradle task 'assembleDebug'...                             70,2s
Error: Gradle task assembleDebug failed with exit code 1 


Steps to Resolve the Issue

  1. Update Android Studio:

    • Open Android Studio.
    • Check for Updates: Go to Android Studio in the top menu bar and select Check for Updates....
    • Install the Update: Follow the prompts to download and install the latest version of Android Studi

 

Comments