'Gradle build failed to produce an .apk file while connecting AppCenter to GitHub

I want to build a flutter app through AppCenter by connecting to github, but getting this error:

Gradle build failed to produce an .apk file. It's likely that this file was generated under /Users/runner/work/1/s/build, but the tool couldn't find it.



Solution 1:[1]

Flutter is not supported by App Center, see this issue Flutter Support. There are ways to get the build working, you will find instruction from the issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user18309290