When I create a new flutter project the project always failed to run and output the exception that shown in the below
I tried to delete the folder .gradle and rerun the project but I get the same problem how can I solve this problem? Launching lib\main.dart on sdk gphone64 x86 64 in debug mode... Running Gradle task 'assembleDebug'... FAILURE: Build failed with an exception.
Could not resolve all files for configuration ':gradle:detachedConfiguration1'. Could not find org.codehaus.groovy:groovy:?.?.??. Searched in the following locations: - https://dl.google.com/dl/android/maven2/org/codehaus/groovy/groovy/?.?.??/groovy-?.?.??.pom - https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy/?.?.??/groovy-?.?.??.pom Required by: project :gradle Could not find org.codehaus.groovy:groovy-ant:?.?.??. Searched in the following locations: - https://dl.google.com/dl/android/maven2/org/codehaus/groovy/groovy-ant/?.?.??/groovy-ant-?.?.??.pom - https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-ant/?.?.??/groovy-ant-?.?.??.pom Required by: project :gradle Could not find org.codehaus.groovy:groovy-astbuilder:?.?.??. Searched in the following locations: - https://dl.google.com/dl/android/maven2/org/codehaus/groovy/groovy-astbuilder/?.?.??/groovy-astbuilder-?.?.??.pom - https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-astbuilder/?.?.??/groovy-astbuilder-?.?.??.pom Required by: project :gradle
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.
This problem because of the new version of flutter 3.13 I face this problem and there is the solution: 1. Download the previous version for flutter like 3.10 2. delete your .gradle from your system disk the path of the folder like: C:\Users'your user name'
3.Rerun the project again
- if this doesn't work do this with the previous steps :
1. make your system in ENGLISH if the system in another language 2. make sure the path of flutter that you added to enviroment variable is in Lowercase and dont have any symbol there is an example how it should to be: C:\development\flutter\bin 'Notice: if the path have any Uppercase or custom symbol you have to edit the name of the folders in your windows explorer then add the path to enviroment variable '
3.Make sure your Regional Format in US from: Settings -> Time & Language -> Region -> Regional Format
5.Rerun the project again