Facing issue in Flutter Gradle file - android

Can any one have any idea why this error happening.
Launching lib\main.dart on SM G900H in debug mode...
Initializing gradle...
Resolving dependencies...
Error running Gradle:
Exit code 1 from: D:\NewFlutter\App\testapp\flutter_app\android\gradlew.bat app:properties:
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 gradle.jar (com.android.tools.build:gradle:3.1.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.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 21s
Finished with error: Please review your Gradle project setup in the android/ folder.

Related

assembleRelease task failed when building a Flutter project

Building with sound null safety
Running Gradle task 'assembleRelease'...
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 builder-4.1.0.jar (com.android.tools.build:builder:4.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/4.1.0/builder-4.1.0.jar
Could not find bundletool-0.14.0.jar (com.android.tools.build:bundletool:0.14.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.14.0/bundletool-0.14.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 6s
Running Gradle task 'assembleRelease'... 10.9s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
Try to build your project with following three steps:
1- flutter build apk --debug
2- flutter build apk --profile
3- flutter build apk --release

BUILD FAILED in Flutter Project

Launching lib\main.dart on Mi A1 in debug mode...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
C:\Users\anand.gradle\caches\transforms-2\files-2.1\9d2250f2160023e86dcf90b2c8c1bc31\core-1.7.0-beta01\res\values\values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar 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 1m 57s
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
Building plugin admob_flutter...
√ Built build\app\outputs\repo.
Building plugin agora_rtc_engine...
FAILURE: Build failed with an exception.
Where:
Build file 'C:\src\flutter.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-4.0.7\android\build.gradle' line: 29
What went wrong:
A problem occurred evaluating root project 'agora_rtc_engine'.
Plugin with id 'com.android.library' 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 2s
Exception: The plugin agora_rtc_engine could not be built due to the issue above.
Exited (sigterm)

Flutter Gradle task assembleDebug failed with exit code 1

I am trying to run flutter project on my phone but I get this exception:
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 com.android.tools.build:gradle:4.1.3.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.jar
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 2s
Exception: Gradle task assembleDebug failed with exit code 1
Please try the following steps:
Delete the android directory.
Run flutter clean comment
Run flutter create . comment
Run flutter pub get comment
Run the application.

Build failed with some exception in flutter

suddenly while starting my app in visual studio code, i got the following lines as errors..
Launching lib\main.dart on RMX1801 in debug mode...
* Error running Gradle:
ProcessException: Process "C:\Users\sanjay\demo\android\gradlew.bat" exited abnormally:
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 com.android.tools.build:gradle:6.0.1.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.0.1/gradle-6.0.1.pom
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.0.1/gradle-6.0.1.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/6.0.1/gradle-6.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/6.0.1/gradle-6.0.1.jar
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 39s
Command: C:\Users\sanjay\demo\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
Exited (sigterm)
can anyone tell me how to resolve this issue.
I think this version of gradle not supported just use an other version by changing class path in my case:
dependencies {
classpath'com.android.tools.build:gradle:3.2.1' }

Unable to run flutter sample in android studio

i am new in flutter i just want to start it with android studio
but when i am just try to the simple app it shows me some error
can some one help me
Error running Gradle:
Exit code 1 from: C:\Users\saswatsaubhagya\Desktop\flutter\flutter_app\android\gradlew.bat app:properties:
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\saswatsaubhagya\Desktop\flutter\flutter_app\android\app\build.gradle' line: 25
What went wrong:
A problem occurred evaluating project ':app'.
Could not resolve all files for configuration 'classpath'.
Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.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 39s
Finished with error: Please review your Gradle project setup in the android/ folder.
timeout waiting for the application to start

Categories

Resources