androidflutterfirebasegradlefirebase-mlkit

Gradle project sync failed in Flutter project


Every time my gradle is syncing it gets errors like this. Can someone help me? Error cause after adding firebase_ml_vision dependency.

Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'. Caused by: java.lang.RuntimeException: com.android.build.gradle.internal.crash.ExternalApiUsageException: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:packLibsflutterBuildDebug'. Caused by: com.android.build.gradle.internal.crash.ExternalApiUsageException: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:packLibsflutterBuildDebug'. Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:packLibsflutterBuildDebug'. org.codehaus.groovy.runtime.metaclass.MissingMethodExecutionFailed: No signature of method: org.gradle.api.tasks.bundling.Jar.destinationDir() is applicable for argument types: (File) values: [C:\Users\37499\AndroidStudioProjects\flutter_ml_demo\build\app\intermediates\flutter\debug]

I tried changing gradle, java and firebase versions but that don't help.


Solution

  • I solved the problem caused by some deprecated dependencies on Firebase ML by creating a new project and using new dependencies that utilize Google ML Kit instead.