Flutter build failed with exception - flutter

When I tried to run a flutter project it shows
BUILD FAILED WITH EXCEPTION
user1#user MINGW64 /c/src/projects/app
$ flutter run
Launching lib\main.dart on Samsung Galaxy S3 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Where:
Build file 'C:\src\projects\app\android\build.gradle' line: 8
What went wrong:
A problem occurred evaluating root project 'android'.
Could not create service of type ComponentMetadataSupplierRuleExecutor using DependencyManagementBuildScopeServices.createComponentMetadataSupplierRuleExecutor().
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 55s
Running Gradle task 'assembleDebug'... 77.7s
Gradle task assembleDebug failed with exit code 1
Can anyone tell why this happens, and how I can fix it, please?

Related

im trying to solve the following problem in my flutter application

Launching lib\main.dart on sdk gphone x86 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\LENOVO\Videos\mine\untitled\android\build.gradle' line: 26
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Could not open proj generic class cache for build file 'C:\Users\LENOVO\Videos\mine\untitled\android\app\build.gradle' (C:\Users\LENOVO.gradle\caches\7.5\scripts\7pezi9yrwlo20hxg93al5b3wr).
> BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 63
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 4s
Exception: Gradle task assembleDebug failed with exit code 1
please help im really hit.

Execution failed for task ':sign_in_with_apple:parseDebugLocalResources'. vscode

i tried to use the flutter stripe dependecy , then i had to upgrade gradle and kotlin i struggled a little they supposed to me to delete gradle-wrapper.jar,then it get created as damaged file, after that i am getting this error
Launching lib\main.dart on CPH2043 in debug mode...
lib\main.dart:1
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sign_in_with_apple:parseDebugLocalResources'.
> Could not resolve all files for configuration ':sign_in_with_apple: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\Dell\AppData\Local\Android\sdk\platforms\android-28\android.jar.
> C:\Users\Dell\AppData\Local\Android\sdk\platforms\android-28\android.jar
* 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 1m 49s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
i tried flutter pub cache repair ,
i tried gradlew clean build ,
i desinstall and install flutter extention ,

Could not create service of type FileHasher using BuildSessionServices.createFileHasher() in flutter

Launching lib\main.dart on M2010J19SI in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Gradle could not start your build.
Could not create service of type FileHasher using BuildSessionServices.createFileHasher().
Unexpected lock protocol found in lock file. Expected 3, found 0.
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 11s
Exception: Gradle task assembleDebug failed with exit code 1
Blockquote

flutter url_launcher plugin causing the problem

Launching lib\main.dart on Android SDK built for x86 in debug mode...
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration of task ':url_launcher:createFullJarDebug'.
File 'C:\Users\Narender\AndroidStudioProjects\the_makeable_app\build\url_launcher\intermediates\runtime_library_classes\debug\classes.jar' specified for property 'libraryInputFile' does not exist.
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
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

can not generate flutter apk file

I'm trying to generate flutter apk file using the following command
flutter build apk --target-platform=android-arm
but I've got the following error
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all files for configuration ':app:releaseCompileClasspath'.
Could not download flutter_embedding_release.jar (io.flutter:flutter_embedding_release:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c)
Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/flutt
er_embedding_release-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.jar'.
Read timed out
Could not download armeabi_v7a_release.jar (io.flutter:armeabi_v7a_release:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c)
Could not get resource 'http://download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/armeabi_v7a
_release-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.jar'.
Read timed out
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 insigh
ts.
Get more help at https://help.gradle.org
BUILD FAILED in 1m 3s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 64.6s
Gradle task assembleRelease failed with exit code 1
how to solve this problem ??