I am trying to code an app for the first time with flutter in vs code and I am getting this error,
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\ajgoc\Desktop\Badges\badges_gram\buddies_gram-master\android\build.gradle' line: 29
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Failed to notify project evaluation listener.
> 'org.gradle.api.file.DirectoryProperty org.gradle.api.file.ProjectLayout.directoryProperty(org.gradle.api.provider.Provider)'
Exception: Gradle task assembly debug failed with exit code 1
I have tried a couple of things to fix it but haven't gotten anything to work. The app will still load in the emulator but it is an older version of the app. Here is what my gradle-wrapper.poperties and build.gradle files look like.
gradle-wrapper.poperties
build.gradle
flutter doctor -v output
Related
this is happening when running the flutter default app.
build is failing with an exception.
in the img it may be showing evaluating :app but now it is also showing problem occured evaluating project android.
I am getting this while trying to run build 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.res.LinkApplicationAndroidResourcesTask$TaskAction
> java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
I already ran flutter clean then flutter pub get before launching the app again. It still not going!
The flutter doctor command result is OK and fine too
Try this solution by adding this line to gradle.properties.
org.gradle.jvmargs=-Xmx4608m
It finally worked!
I solved the problem by adding adding org.gradle.jvmargs=-Xmx4608m in the gradle.properties file and deleting the./gradle/cahes directly ✔️
I am severely getting error:
FAILURE: Build failed with an exception.
Where:
Script '~\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
'~/flutter\bin\flutter.bat' finished with non-zero exit value 1
Currently I am using flutter 2.10.4. Waiting to upgrade with newer version but unfortunately gone few days because of work.
Tried deleting cache and build files. Clean and rebuild the project, nothing works.
Any help would be a great support!
Flutter run produces the following error:
Target debug_android_application failed: Exception: Failed to bundle asset files.
build failed.
FAILURE: Build failed with an exception.
Where:
Script '/Users/kirk/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/kirk/Developer/flutter/bin/flutter'' finished with non-zero exit value 1
Any potential solutions on how to fix this?
i think that you have compatibility issues between the build tools located in android/build.gradle and the gradle located in android/gradle/wrapper/gradle-wrapper.properties, try upgrade or downgrade one of them to be compatible with the other, check this table for compatibilites: https://developer.android.com/studio/releases/gradle-plugincompatibilites
I had exactly the same problem where I couldn't compile or debug my Flutter app. To solve this, just go to tools and in Flutter selection, click on {open project for editing in Android Studio}. This will open only the Android counterpart and you will be able to update your gradle dependencies once the analysis is finished.
I have face similar issues so after spending lot of time i have found if we can write full path for assests file then it works please check below example how it is defined.
assets:
- assets/bg_screen_page.png
- assets/logo.png
This is what I'm receiving from Android Studio, but I don't know how to fix this in the latest version.
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.internal.version-check']
> Minimum supported Gradle version is 5.6.4.
Edit: I changed the gradle-wrapper.properties to
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
And now also went to File/Settings/Build, Execution, Deployment/Gradle, and changed the Gradle User Home to a gradle-5.6.4 that I downloaded.
But now, I'm receiving this:
Finished with error: Gradle task assembleDebug failed with exit code 1