2

I am getting this error with my flutter project. The exact same code is working just fine with my other team members, it is only me getting the error. I've searched for the solutions and found some answers saying it would be a problem with the build gradle file. But I couldn't find the solution for me.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Multiple task action failures occurred:
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > D:\git\da_eat_da\build\fluttertoast\intermediates\aar_metadata\debug\aar-metadata.properties (         θ  ã           ϴ )
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > D:\git\da_eat_da\build\shared_preferences\intermediates\aar_metadata\debug\aar-metadata.properties (         θ  ã           ϴ )
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > D:\git\da_eat_da\build\google_maps_flutter\intermediates\aar_metadata\debug\aar-metadata.properties (         θ  ã           ϴ )
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > D:\git\da_eat_da\build\flutter_plugin_android_lifecycle\intermediates\aar_metadata\debug\aar-metadata.properties (         θ  ã           ϴ )
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > D:\git\da_eat_da\build\sqflite\intermediates\aar_metadata\debug\aar-metadata.properties (         θ  ã           ϴ )
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > D:\git\da_eat_da\build\geolocator\intermediates\aar_metadata\debug\aar-metadata.properties (         θ  ã           ϴ )
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > D:\git\da_eat_da\build\path_provider\intermediates\aar_metadata\debug\aar-metadata.properties (         θ  ã           ϴ )
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > D:\git\da_eat_da\build\google_mobile_ads\intermediates\aar_metadata\debug\aar-metadata.properties (         θ  ã           ϴ )

* 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 37s
Exception: Gradle task assembleDebug failed with exit code 1

This is my build:gradle \app

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 30

    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.da_eat_da"
        minSdkVersion 21
        targetSdkVersion 30
        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"
}

yejin kim
  • 29
  • 1
  • 2
  • 3
    Does this answer your question? [Execution failed for task ':app:checkDebugAarMetadata'](https://stackoverflow.com/questions/64521804/execution-failed-for-task-appcheckdebugaarmetadata) – RaSha May 22 '21 at 13:06
  • https://stackoverflow.com/a/67620329/11623001 This answers the question perfectly actually. – Denzel Jul 23 '21 at 09:43

1 Answers1

0

just add this code block to the end of build.gradle file in app level

configurations.all {
    resolutionStrategy {
        force 'androidx.core:core-ktx:1.6.0'
    }
}   
Mixpeal
  • 33
  • 4