HAK
HAK

Reputation: 2071

Gradle works with Android Studio but cmd script fails

I freshly installed Android Studio and created a HelloWorld project. It works fine. But when I tried to build it via commandline gradlew script found in the project directory it first gave me the error that java is not installed.

After installing the java its now giving me the error:

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine java version from '11.0.1'.

  • 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

Following image shows the java version and the command I executed:

error image

Note: I am running it on a Mac with MacOS High Sierra (10.13.6)

Upvotes: 1

Views: 602

Answers (1)

HAK
HAK

Reputation: 2071

This had something to do with my gradle version. I set the version to the latest by going to Project Structure selecting Project from side menu and set the Gradle version to 4.10.2.

Upvotes: 1

Related Questions