Exception: [!] your app is using an unsupported gradle project.
To fix this problem, you need to create a new Flutter project and then move your existing Dart code, assets, and pubspec.yaml file to the new project. Follow the steps below to resolve the issue:
- Open your terminal or command prompt.
- Run the following command:
flutter create -t app <app-directory>
Replace <app-directory>
with the desired directory name for your new Flutter project.
For example, if you want your new project to be named “my_flutter_project”, you should run:
flutter create -t app my_flutter_project
This command will create a new Flutter project with the necessary gradle configuration files.
- After the new project is created, navigate to the directory containing your existing Flutter app that is encountering the unsupported gradle project error.
- Copy the Dart code, assets, and pubspec.yaml file from your existing project to the corresponding directories in the newly created project.
Make sure to replace any existing files in the new project with the ones from the existing project.
Once you have moved all the necessary files, your new project should have the correct gradle configuration and you should be able to build and run your app without encountering the unsupported gradle project error.