Skip to content
Advertisement

Getting Errors in Flutter while creating first app app:checkDebugDuplicateClasses

I am just trying to launch the first basic created code on flutter which is the counter button on the screen, now if I try to Debug it then it always gets messed up in all sorts of errors. Currently, the error is this:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform kotlin-stdlib-jdk7-1.3.50.jar (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for EnumerateClassesTransform: C:UsersShaffan.gradlecachestransforms-2files-2.16697cfdd11e9fefb1f002637ca986f5ejetified-kotlin-stdlib-jdk7-1.3.50.jar.
         > Cannot parse result path string:                                       
   > Failed to transform annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for JetifyTransform: C:UsersShaffan.gradlecachesmodules-2files-2.1androidx.annotationannotation1.1.0e3a6fb2f40e3a3842e6b7472628ba4ce416ea4c8annotation-1.1.0.jar.
         > Cannot parse result path string:     
   > Failed to transform kotlin-stdlib-1.3.50.jar (org.jetbrains.kotlin:kotlin-stdlib:1.3.50) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for EnumerateClassesTransform: C:UsersShaffan.gradlecachestransforms-2files-2.1aa48591568018e27fbbfd58c8ab4f3a5jetified-kotlin-stdlib-1.3.50.jar.
         > Cannot parse result path string:

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

Advertisement

Answer

Hi Usually this is caused by something unwanted being cached, there are two ways to fix this usually:

  1. Run flutter clean inside terminal from the root of your flutter project. Restart your emulator and rebuild the project.

  2. If that doesn’t work, close Android Studio, Navigate to your gradle cache, C:/Users/YourUser/.gradle/caches and delete everything inside, then reopen Android Studio and try again.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement