I am facing the same issue along with another issue
Execution failed for task ‘:app:checkDebugAarMetadata’.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> 2 issues were found when checking AAR metadata:
1. Dependency 'androidx.core:core:1.17.0' requires Android Gradle plugin 8.9.1 or higher.
This build currently uses Android Gradle plugin 8.7.3.
2. Dependency 'androidx.core:core-ktx:1.17.0' requires Android Gradle plugin 8.9.1 or higher.
This build currently uses Android Gradle plugin 8.7.3.
This error occurs on building the android part of a Flutter app. The error is probably due to some version mismatch somewhere I can’t see. I created a totally new project but still this is happening. I also changed android sdk or ndk recently through AS. Previously I had something on version 26 which got deleted while playing around with it but currently I have 28.1.13356709.
That’s not so much a Gradle question, it’s not even a Gradle error message, but one from the Android Gradle Plugin.
I recommend to ask in some Android or Flutter community if you need further help.
But the error message sounds quite clear to me. You depend on a version of androidx.core that requires a newer AGP version than you are using, so you probably need to downgrade that dependency or upgrade the used AGP.
If what is connected?
Inability to sync the project and that error?
Probably not, the error you showed happens at task execution time: “Execution failed for task ‘:app:checkDebugAarMetadata’.”
Syncing the project should not be affected by a task execution problem usually.
But well, Android projects are always “a bit” special.
Where do you see the error?
In the Sync output?
If so, then probably yes.
That was not clear from your post, as you did not ask about that, hence I forked it off as you seemed to just ask for your error, sorry.
But I just answered your question in my last reply.