Finished with non-zero exit value 1
In case, you are getting this error, there could multiple reasons for this. To solve this error, we have covered all the possible solutions here.
- Open the terminal in Android studio.
- Enter flutter clean command in terminal.
- After finish processing, hit second command flutter pub get.
- Run your project.
- Open your project folder and show all hidden files and folder.
- Then removing .dart_tool folder, .idea folder, build folder, .packages, .pubspec.lock files in project root directory.
- Open android folder and removing .gradle folder, .idea folder, local.properties files.
- At the end, restart your project and then open pubspec.yaml file click in to pub get and run.
- Make sure that your full project path is less than 80 characters.
- If you are using ‘import dart:js’ in any .dart file, kindly remove it.
- Turn off if anti virus is on, before build.
- Anti virus disable in Windows.
- Select Start > Settings > Update & Security > Windows Security > Virus & threat protection > Manage settings (or Virus & threat protection settings in previous versions of Windows 10).
- Switch Real-time protection to Off. Note that scheduled scans will continue to run.
- Anti virus disable in mac.
- 1. Access the Mac menu bar, and there you should see the antivirus icon.
- 2. Right-click it or just left click and a drop-down menu appears.
- 3. Click the ideal function such as
Disable or Stop and if it asks for any confirmation, hit “Yes” or “Confirm.”.