My flutter project output runs on chrome web and windows desktop but when I try it for mobile emulator (AVD) I encounter this Error :
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
lib\main.dart:1
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:7.1.2.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.1.2/gradle-7.1.2.pom
- https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.1.2/gradle-7.1.2.pom
Required by:
project :
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 44s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Related
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.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find annotations-27.1.0.jar (com.android.tools:annotations:27.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/annotations/27.1.0/annotations-27.1.0.jar
> Could not find databinding-common-4.1.0.jar (androidx.databinding:databinding-common:4.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-common/4.1.0/databinding-common-4.1.0.jar
> Could not find baseLibrary-4.1.0.jar (com.android.databinding:baseLibrary:4.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/databinding/baseLibrary/4.1.0/baseLibrary-4.1.0.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 1s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
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?
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)
Launching lib\main.dart on Android SDK built for x86 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not download kotlin-compiler-embeddable.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.50)
Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.3.50/kotlin-compiler-embeddable-1.3.50.jar'.
Connection reset
* 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 44m 49s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
you may have net problem. Check connection and try again. This may solve your problem