* What went wrong: A problem occurred evaluating root project 'android'. > Cannot add task 'clean' as a task with that name already exists

How could I solve this trouble?

PS C:\Users\wongp\Music\E-commerce-Complete-Flutter-UI-master\android> ./gradlew signingReport

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\wongp\Music\E-commerce-Complete-Flutter-UI-master\android\build.gradle' line: 53

* What went wrong:
A problem occurred evaluating root project 'android'.
> Cannot add task 'clean' as a task with that name already exists.

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

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring root project 'android'.
> compileSdkVersion is not specified. Please add it to build.gradle

* 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 1s

Please learn how to use the formatting on the forum or your posts are very hard to read.

Regarding the question, I fear I have to ask again.
What is unclear?
There are two error messages and both seem quite clear to me.

For second error as below, it is the problem located at andriod/build.gradle or andriod/app/build,gradle?

  • What went wrong:
    A problem occurred configuring root project ‘android’.

compileSdkVersion is not specified. Please add it to build.gradle

andriod’s app build.gradle:

plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
    id 'com.google.gms.google-services'
}


def localProperties = new Properties() //TODO REMOVE THE COMMENT
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

android {
//    namespace "com.ServiceX"
    //compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion
    compileSdkVersion 30

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        applicationId "com.WPS.ServiceX"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion 30

//        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation platform('com.google.firebase:firebase-bom:32.8.1')
    implementation 'com.google.firebase:firebase-analytics'
}

andriod’s build.gradle:


buildscript {
    ext.kotlin_version = '1.7.10'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

//tasks.register("clean", Delete) {
//    delete rootProject.buildDir
//}
plugins {
    id 'com.google.gms.google-services' version '4.4.1' apply false
    id "com.android.application"
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

dependencies {
    //Import the BoM for the Firebase platform
    implementation(platform("com.google.firebase:firebase-bom:32.8.1"))

    // Add the dependency for the Firebase Authentication library
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation("com.google.firebase:firebase-auth")
}

I’m not into Android at all.
But looking at the build scripts you posted, I’d guess your problem is that you apply the Android application plugin to the root project and there it is then missing the compileSdkVersion.
You probably did that to be able to specify the Firebase Auth dependency.
But if you have the typical project layout it does not really make sense to have that dependency there.
So I guess you need to move the Firebase Auth dependency to your app subproject and stop applying the Android application plugin to the root project.