Ammar Mohamed
Ammar Mohamed

Reputation: 790

Flutter build app failed Execution failed for task ':app:checkDebugAarMetadata'

I received the following error while trying to build flutter app on Android Studio

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.otaliastudios:transcoder:0.9.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
       - https://repo.maven.apache.org/maven2/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
       - https://storage.googleapis.com/download.flutter.io/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
     Required by:
         project :app > project :video_compress

I tried flutter clean flutter pub cache repair and also deleting pubspec.lock .. still the problem isn't solved

Here is the result of flutter doctor

[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.22621.819], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.73.1)
[√] VS Code, 64-bit edition (version 1.64.1)
[√] Connected device (4 available)
[√] HTTP Host Availability

Upvotes: 1

Views: 2853

Answers (2)

hazem ashraf
hazem ashraf

Reputation: 1

in my case, deleting pubspec.lock and then run flutter pub get to generate the file again fixed the issue.

Upvotes: 0

Ammar Mohamed
Ammar Mohamed

Reputation: 790

I was able to find a solution by adding this line in the project level build.gradle thanks to this answer

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url "https://plugins.gradle.org/m2/" } //Added this line
    }
}

Another solution that also worked for me but uses jcenter() which apparently reached end of service

allprojects {
    repositories {
        google()
        jcenter() //instead of mavenCentral()
    }
}

apparently it's gradle servers problem but not sure if this is the best solution, however it worked for me.

Upvotes: 11

Related Questions