FAILURE: Build failed with an exception. Execution failed for task ':fluttertoast:compileDebugKotlin' - flutter

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':fluttertoast:compileDebugKotlin'.
Compilation error. See log for more details
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
┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then │
│ update F:\Flutter Projects\clima\android\build.gradle: │
│ ext.kotlin_version = '' │
└──────────────────────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
I am getting such an error when i try to build my flutter project in android studio. Please help someone.

Related

Flutter build no-shrink [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 9 days ago.
Improve this question
I am creating a mobile app and then tried to run the application in an android physical and then received this message in the terminal:
Launching lib\main.dart on vivo 1718 in debug mode...
Running Gradle task 'assembleDebug'...
ERROR:C:\Users\ADMIN\StudioProjects\dogcare_app\build\app\tmp\kotlin-classes\debug\com\example\dogcare_app\MainActivity.class: D8: Type com.example.dogcare_app.MainActivity is defined multiple times: C:\Users\ADMIN\StudioProjects\dogcare_app\build\app\tmp\kotlin-classes\debug\com\example\dogcare_app\MainActivity.class, C:\Users\ADMIN\StudioProjects\dogcare_app\build\app\intermediates\javac\debug\classes\com\example\dogcare_app\MainActivity.class
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexBuilderDebug'.
> There was a failure while executing work items
> A failure occurred while executing com.android.build.gradle.internal.dexing.DexWorkAction
> Failed to process: C:\Users\ADMIN\StudioProjects\dogcare_app\build\app\tmp\kotlin-classes\debug, C:\Users\ADMIN\StudioProjects\dogcare_app\build\app\intermediates\javac\debug\classes
* 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 38s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode. │
│ To disable the shrinker, pass the `--no-shrink` flag to this command. │
│ To learn more, see: https://developer.android.com/studio/build/shrink-code │
└────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1

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.

i cant found the minSdkVersion 16 in the build.gradle

* What went wrong:
Execution failed for task ':app:dexBuilderDebug'.
> There was a failure while executing work items
> A failure occurred while executing com.android.build.gradle.internal.dexing.DexWorkAction
> Failed to process: C:\Users\El.Sa7er\AndroidStudioProjects\test_1\build\app\tmp\kotlin-classes\debug, C:\Users\El.Sa7er\AndroidStudioProjects\test_1\build\app\intermediates\javac\debug\classes
* 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 10s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode. │
│ To disable the shrinker, pass the `--no-shrink` flag to this command. │
│ To learn more, see: https://developer.android.com/studio/build/shrink-code │
└────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
this is the error
i do not found the minSdkVersion 16
in build.gradle and i dont understand what is error
In your code, In line number 42 is the minSdkVersion. Remove the line and replace it with this line. Sometimes it does not work, so clean the project and build again
minSdkVersion 21

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 ,

Unable to build an apk in flutter

I am trying to build an api from my flutter project, last month it was fine when I was doing flutter build apk, but not for now... I am not able to do that and here is the error log
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-location:16.+.
Required by:
project :app > project :location
> Failed to list versions for com.google.android.gms:play-services-location.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'. Received status code 403 from server: Forbidden
* 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 33s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 34.3s
Gradle task assembleRelease failed with exit code 1
here is my android/build.gradle: https://gist.github.com/wahyu-handayani/959de3306aa1410c1b9b78ad927cc35c
Try to update your gradle wrapper to:
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip