Flutter build apk --debug fails to find output file

On my flutter firebasestudio project I get an error when I try to build my app. This is a new project and it’s my first build of the project.

When I run “flutter build apk --debug” I get the error “Gradle build failed to produce an .apk file. It’s likely that this file was generated under /home/user/myapp/build, but the tool couldn’t find it.”

The build file was actually created:
~/myapp{main}$ find /home/user -name “app-debug.apk” 2>/dev/null
/home/user/myapp/android/app/build/outputs/flutter-apk/app-debug.apk
/home/user/myapp/android/app/build/outputs/apk/debug/app-debug.apk

through trial and error, I found that if I manually move one of those apks to /home/user/myapp/build/app/outputs/flutter-apk/app-debug.apk then a rerun of “flutter build apk --debug” is successful.

I have a work around of manually copying the file so I can keep working but does anyone know how to fix this situation? I can’t find a configuration for either the location of the output or the location of the check for the output.