get exit code 1 when run flutter project - flutter

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()
}
}

Related

What is the reason for error of exit with code 1

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..

How to solve Could not determine the dependencies of task ':app:lintVitalRelease' [status code 502 from server: Bad Gateway]

Hi I am trying to build an app of flutter, but I get this error log
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
> 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 502 from server: Bad Gateway
* 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 7m 49s
I have tried to follow the step in this link Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
but I still get the error, is there a way to sole this case. I have been trying to solve this since yesterday, but still get the error. And here is my android/build.gradle
buildscript {
ext.kotlin_version = '1.3.61'
repositories {
google()
// jcenter()
mavenCentral()
}
dependencies {
// classpath 'com.android.tools.build:gradle:3.5.0'
// classpath 'com.android.tools.build:gradle:3.4.2'
classpath "com.android.tools.build:gradle:4.2.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
google()
// jcenter()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
//
and also I implement distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip inside Gradle-wrapper.properties

Execution failed for task ':app:processDebugResources' in VS code flutter

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)

Flutter Error FAILURE: Build failed with an exception

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.

Gradle error when compiling flutter project

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