I use Gradle for flutter, just updated it to 7.2. and I am in windows.
Running the Gradle command on the Command prompt returns me an error that I don’t have the ‘settings.gradle(.kts)’ file.
Before upgrading everything was smooth except the depreciated API warning. I have deleted the old gradle build so I cant get a reference.
I have searched the web but no one is able to answer.
Here is my complete error prompt-
C:\Users\bspma>gradle
FAILURE: Build failed with an exception.
* What went wrong:
Executing Gradle tasks as part of a build without a settings file is not supported. Make sure that you are executing Gradle from a directory within your Gradle project. Your project should have a 'settings.gradle(.kts)' file in the root directory.
* 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 1s
Will the issue be solved by downloading the Settings file from the git repo? Then where to place it?
I am sorry if I am posting the wrong things to the wrong location then please show me the right one.
Hello Chris, thank you for responding.
Pardon my naivety, I was referring to the Git repo of Gradle itself.
The file is the second from last on the list.
Creating a gradle.settings file in the root directory ( gradle7.2>settings.gradle ) didn’t solve the issue for me. Even adding a .kts didn’t.
I have referred to this adress but failed to understand how to create the file and what to put inside that. I also missed what is the proper procedure for creating the file from scratch. Should I create a text file and the convert it to .gradle ?
I have also tried putting these lines inside below inside that self-made settings.gradle file but no progress. rootProject.name = 'basic' println 'This is executed during the initialization phase.'
Yes, settings.gradle is just a text file like build.gradle.
Your project’s settings.gradle should live in the same directory as the project’s build.gradle. If you have a multi-project build with projects in subdirectories then there should only be one settings.gradle file in the top-most directory of the project (the root directory of the project).
Yes, your flutter application is the project and that is what I have been talking about. You do not need to modify anything in your gradle installation directory. Every project has its own settings file.