Finished with error: Gradle task assembleDebug failed with exit code 1 in Flutter - flutter

Compiler message:
lib/range_slider.dart:2:8: Error: Can't access platform private library.
import 'dart:_http';
^
Compiler failed on /Users/user/FlutterApp/cliniva_doctor_app/lib/main.dart
FAILURE: Build failed with an exception.
Where:
Script '/Users/user/Library/FlutterSDK/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 782
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebugArm64'.
Process 'command '/Users/user/Library/FlutterSDK/flutter/bin/flutter'' finished with non-zero exit value 1
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 12s
Finished with error: Gradle task assembleDebug failed with exit code 1

Related

When I try run a cloned flutter project. I get this exception > Execution failed for task ':app:compileFlutterBuildDebug'

FAILURE: Build failed with an exception.
Where:
Script '/home/joker/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/home/joker/snap/flutter/common/flutter/bin/flutter'' finished with non-zero exit value 1
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 48s
Exception: Gradle task assembleDebug failed with exit code 1

Execution failed for task ':app:compileFlutterBuildDebug'. > Process 'command 'C:\Users\DELL\Documents\flutter\bin\flutter.bat''

Launching lib\main.dart on Android SDK built for x86 in debug mode...
: Error: Expected ';' after this.
});0
^
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\DELL\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\Users\DELL\Documents\flutter\bin\flutter.bat'' finished with non-zero exit value 1
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 26s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Github : https://github.com/Pavel401/rainbow
I tried to find " });0" in all dart files but couldn't find anything.It took me 30 days of work to get here . I added the repo link for code .

Exception: Gradle task assembleDebug failed with exit code 1 finished with non-zero exit value 1

FAILURE: Build failed with an exception.
Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
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 17s
check if you can update your flutter version
Also you could try flutter clean, and then flutter pub get

I got an error named there is no attribute "BoxShadow". I have a code as follows:

179:22: Error: No named parameter with the name '#2'.
BoxShadow(
^^...
/C:/src/flutter/packages/flutter/lib/src/painting/box_shadow.dart:35:9: Context: Found this candidate, but the arguments don't match.
const BoxShadow({
^^^^^^^^^
FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1
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 34s
Exception: Gradle task assembleDebug failed with exit code 1

How Can solve it?

When I try to run main.dart in USB device (Nokia 3.1 Plus) I have this in the Debug Console :
FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 769
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebugArm64'.
Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
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 37s
Gradle task assembleDebug failed with exit code 1
flutter doctor shows any problem
Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 769
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebugArm64'.
Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
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 37s
Gradle task assembleDebug failed with exit code 1