To ensure everything runs smoothly, please follow these steps:
-
Flutter SDK: Ensure you have Flutter SDK version 3.27.32 installed.
-
Android Studio: Use Android Studio Koala or Ladybug Feature Drop 3.
-
Delete Files:
-
Remove the
pubspec.lock
file. -
Delete the
build
folder if it exists.
-
-
Run Flutter Clean: Open the terminal and execute the command:
-
If the Issue Persists: Try building the project manually:
-
Go to File in Android Studio and select Open.
-
Open this project’s Android folder in a separate Android Studio window.
-
Build the project (this may take some time).
-
If you encounter any issues:
-
Navigate to File > Settings > Build, Execution, Deployment. Expand this section and then select Build Tools > Gradle.
-
Set the Gradle version to 21.
-
Sync the project again via File > Sync Project with Gradle Files.
-
-
-
Return to the Main Project Window: Once the Gradle sync is complete, go back to the original project window and try running it again.