Execution failed for task path_provider:parseDebugLibraryResources - flutter

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':path_provider:parseDebugLibraryResources'.
Could not resolve all files for configuration ':path_provider:androidApis'.
Failed to transform file 'android.jar' to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
Execution failed for PlatformAttrTransform: C:\Users\Jay Prajapati\AppData\Local\Android\sdk\platforms\android-28\android.jar.
Cannot parse result path string:
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 9s
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

FAILURE: Build failed with an exception.I get this error

I went through all the threads but couldn't solve the problem. I keep getting this error every time I run the project.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':barcode_scan2:generateDebugProto'.
protoc: stdout: . stderr: D:\Yeni klasor\flutter.pub-cache\hosted\pub.dartlang.org\barcode_scan2-4.2.1\protos: warning: directory does not exist.
Could not make proto path relative: D:\Yeni klasor\flutter.pub-cache\hosted\pub.dartlang.org\barcode_scan2-4.2.1\protos\android_configuration.proto: No such file or directory
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 13s
Exception: Gradle task assembleDebug failed with exit code 1

Error incorrect settings while building a flutter project

i work on windows and i get this error while running a flutter project , so it work on chrome but on the real device phone or emulator it does not .
this the error :
Format incorrect du param�tre -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared_preferences_android:parseDebugLocalResources'.
> Could not resolve all files for configuration ':shared_preferences_android:androidApis'.
> Failed to transform android.jar to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for PlatformAttrTransform: C:\Users\MEJDI BEN HAMIDA\AppData\Local\Android\sdk\platforms\android-31\android.jar.
> zip END header not found
* 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 7s
Running Gradle task 'assembleDebug'... 8,9s
Exception: Gradle task assembleDebug failed with exit code 1

Finished with error: Gradle task assembleDebug failed with exit code 1 in 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

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