FAILURE: Build failed with an exception.
* Where:
Build file 'F:\Flutter New Application (Game Conduct)\gamershub\android\app\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> ASCII
* 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
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 23.6s
Exception: Gradle task assembleDebug failed with exit code 1
My build.gradle file
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am getting the error while running the flutter apk event i have no issues in command flutter doctor -v. But when i try to run my code i am gettent the error. Even after i have created the new project using flutter create i am getting the the same error in that project also.
Related
Launching lib\main.dart on RMX3371 in debug mode...
[Fatal Error] flutter_embedding_debug-1.0.0-8f2221fbef28b478debb78dd233f5250b220ca99.pom:14:6: An invalid XML character (Unicode: 0x0) was found in the element content of the document.
[Fatal Error] kotlin-stdlib-jdk7-1.6.10.pom:2:1: Content is not allowed in prolog.
FAILURE: Build failed with an exception.
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
Running Gradle task 'assembleDebug'... 41.6s
Exception: Gradle task assembleDebug failed with exit code 1
build.gradle file:
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I tried re-installing android studio but the problem still exist..
I have tried gradlew clean and gradlew build but problem still persist so please help me find solution..
I searched everywhere and all I saw was everyone showed solutions in Android studio. I'll share my build.gradle file and my logs. Can someone tell me why flutter is never error free -_-
build.gradle
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Logs
Launching lib\main.dart on sdk gphone64 x86 64 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
D:\Flutter apps\i_am_rich\build\app\intermediates\packaged_manifests\debug\AndroidManifest.xml:16: AAPT: error: resource mipmap/ic_launcher (aka com.example.i_am_rich:mipmap/ic_launcher) 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 24s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
when i run flutter project i get this error .
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
> Problems reading data from Binary store in
C:\Users\Mohammad\AppData\Local\Temp\gradle3241964870133562548.bin offset 235082 exists? true
* 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 2m 8s
Exception: Gradle task assembleDebug failed with exit code 1
i restart my pc and after clean temp directory , also i run flutter clean but this error yet exist please help me my build.gradle file is
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
maven { url "https://maven.google.com/"}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
I am getting this error when i am trying to get the release apk of my app.
Below are all the data.
Console log
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\pro\food\android\build.gradle' line: 30
* 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.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;
* 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 3s
Picked up _JAVA_OPTIONS: -Xms256m -Xmx2048m
Running Gradle task 'assembleRelease'... 4.5s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
android level build.gradle file
buildscript {
repositories {
maven{url 'https://dl.google.com/dl/android/maven2'}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2.'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.1'
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
maven{
url 'https://maven.gppgle.com'
}
google()
jcenter{ url "http://jcenter.bintray.com/"}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle-wrapper properties
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3.2-all.zip
I have tried clearing the caches, restarting android studio.
Someone please help me with this issue.
Any kind of help will be appreciated.
Open your build.gradle file in android folder. (not in app)
inside dependency block, update classpath of tools.build.gradle like this,
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
}
I'm trying to run my flutter app, but it gives the following gradle error, can someone help me? I tried some of the stack's own solutions but n solved it.
My code build.grade is:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This error is:
Message error
UPDATE
I have solved above error but now get error like this,
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using
BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using
BuildSessionScopeServices.createFileSnapshotter().
* 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
Gradle task assembleDebug failed with exit code 1
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().
* 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
Gradle task assembleDebug failed with exit code 1