What is the reason for error of exit with code 1

323 views Asked by At

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.

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

1

There are 1 answers

0
Zeelkumar Sojitra On

-- The error you're encountering indicates that there is an issue with the XML content of some files in your Flutter project. The error messages mention problems in specific .pom (Maven) files.

Update Dependencies: -- flutter upgrade

-- if you are using Android, try updating the Gradle version in your Android project. Open the android/build.gradle file and update the Gradle version.

 -- classpath 'com.android.tools.build:gradle:4.1.3' // or the latest version