Search code examples
androidandroid-studiogradlesonarqubegradlew

Gredlew taskname - command not running Android studio terminal


I was trying to run a Gradle command on android studio terminal but it shows like:- 'grdlew' is not recognized as an internal or external command, operable program or batch file.

the exact command was 'gradlew sonar' Please guide me how to solve this.


Solution

  • After spending a lot of time on it and above solutions also not working for me I found one thing that is my system doesn't have Gradle installed so I installed Gradle into my system and provide the bin folder path in a system environment. Like i.e.

    PATH
    
    D:\gradle-6.0.1\bin
    

    And then go your project directory and open the cmd window there by typing cmd in the file path view and run gradle query like this

    gradle sonarqube

    -Dsonar.projectKey=$REPLACE_WITH_GENERATED_keyCreatedOnSonarqube

    -Dsonar.host.url=http://localhost:9000

    -Dsonar.login=$REPLACE_WITH_GENERATED_TOKEN_OnSonarqube

    And this made my day I hope this will help anyone else also