The term ./gradlew was nnot recognised

Viewed 58

Error picture

./gradlew: The term './gradlew' is not recognized as the name of a cmdlet, function, script file, or operable program. Check 
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ ./gradlew clean./gradlew clean./gradlew clean./gradlew clean
+ ~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (./gradlew:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\walee\Desktop\Coding\Flutter\Flutter Projects\learningdart> ./gradlew clean
./gradlew: The term './gradlew' is not recognized as the name of a cmdlet, function, script file, or operable program. Check   
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ ./gradlew clean
+ ~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (./gradlew:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
1 Answers

Like Rodrigo's comment, you should run gradlew inside the android folder, i.e. C:\Users\walee\Desktop\Coding\Flutter\Flutter Projects\learningdart\android. But this is only going to build the Android version and not the other possible devices like iOS, macOS, Windows, Linux...

Anyway, looks like you're trying to just build a Flutter project. The proper way to do it is to run flutter build in the root folder (the folder learningdart in your case). Now, if you'd like to actually run the app just use the command flutter run. Or if you actually need to clean stuff run both flutter clean and flutter pub get. The former is going to clean not only the Android project but all other devices as well (It calls gradle clean behind the scenes for you) and the latter is going to download all dependencies.

Related