0 I tried to run a brand new Flutter Android App...
# flutter
e
0 I tried to run a brand new Flutter Android App but ran into a Build Gradle problem. This problem is affecting all Flutter apps on my machine... I've never had this type of issue before so kinda confused... details of the error are as follows:
Copy code
FAILURE: Build failed with an exception.

* What went wrong:
Gradle could not start your build.
> Could not create service of type BuildLifecycleController using ServicesProvider.createBuildLifecycleController().
         > Could not configure services using GradleScopeCompileServices.configure().

* 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 34s
Running Gradle task 'assembleRelease'...                           39.5s
Gradle task assembleRelease failed with exit code 1
Things I've tried:
Copy code
1. flutter doctor -v (details below):

    [√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19043.2006], locale en-US)
        • Flutter version 3.0.5 at C:\src\flutter
        • Upstream repository <https://github.com/flutter/flutter.git>
        • Framework revision f1875d570e (3 months ago), 2022-07-13 11:24:16 -0700
        • Engine revision e85ea0e79c
        • Dart version 2.17.6
        • DevTools version 2.12.2
    
    Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK 
    version 32.1.0-rc1)
        • Android SDK at C:\Users\Udhedhe\AppData\Local\Android\Sdk
        • Platform android-32, build-tools 32.1.0-rc1
        • ANDROID_HOME = C:\Users\Udhedhe\AppData\Local\Android\Sdk
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web
        • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
        • Visual Studio Community 2022 version 17.2.32630.192
        • Windows 10 SDK version 10.0.19041.0
    
    [√] Android Studio (version 2021.1)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin can be installed from:
           <https://plugins.jetbrains.com/plugin/9212-flutter>
        • Dart plugin can be installed from:
           <https://plugins.jetbrains.com/plugin/6351-dart>
        • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    
    [√] VS Code, 64-bit edition (version 1.71.0)
        • VS Code at C:\Program Files\Microsoft VS Code
        • Flutter extension version 3.50.0
    
    [√] Connected device (3 available)
        • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19043.2006]
        • Chrome (web)      • chrome  • web-javascript • Google Chrome 106.0.5249.119
        • Edge (web)        • edge    • web-javascript • Microsoft Edge 106.0.1370.42
        ! Device emulator-5554 is offline.
1. I've executed
flutter clean
2. I've executed
flutter packages pub cache clean
3. I've executed
./gradlew clean
in the android folder 4. I've executed
./gradlew build
in the android folder 5. I've restarted my computer 10 million times So far nothing has worked... Here are details of my
build.gradle
file
Copy code
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

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

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

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

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

    defaultConfig {
        // TODO: Specify your own unique Application ID (<https://developer.android.com/studio/build/application-id.html>).
        applicationId "com.example.klant_jamb_prepare"
        // You can update the following values to match your application needs.
        // For more information, see: <https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration>.
        minSdkVersion flutter.minSdkVersion
        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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Here's the details from `java -version`:
Copy code
java version "11.0.15.1" 2022-04-22 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.15.1+2-LTS-10)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.15.1+2-LTS-10, mixed mode)
What can I do now to make this error go away??? Thank you for any help...