So I have came across the same problem, the problem is that when you create a new flutter project. The framework doesn't add a "Build tools" on your app/build.gradle.
The solution to this is that you must add "buildToolsVersion = "34.0.0"" depending on the version of android sdk you're using. Then follow: Flutter : How to change Android minSdkVersion in Flutter Project? to update your flutter dev directory to the latest compileSdkVersion = 34, minSdkVersion = 21, and targetSdkVersion = 34.
It can be any sdk version on minSdkVersion, depending on your project target audience.