Search code examples
androidflutterdartbuildandroid-app-bundle

Can't build an .aab in Flutter


When i'm running

flutter build appbundle

I'm getting the next error:

Gradle build failed to produce an .aab file. Its likely that this file was generated under /path_to_project/build, but the tool couldnt find it.

But i still can create an apk. And i can create an appbundle of a new-created projected.

So, what should i fix to get an opportunity to build .aab? I can't just build a new project and switch code, because this is a 2-years project with some special lines in native code and idk where, because the previous developer added them, not me and i don't have an any connections with him :c


Solution

  • Okay, i had kinda outadated gradle version. So i've changed it in

    • myproject/android/gradle/wrapper/gradle-wrapper.properties
    • myproject/android/build.gradle

    And thats all! Latest version i got from another flutter proj (i just ran flutter create and looked into files of the new project).