I use a technique almost identical to Change apk name with Gradle to change my APK filenames to include the current git hash. Android Studio is caching the APK filename (or doing something that results in the same behavior). This means the resulting APK filename is wrong after each commit unless I tell Android Studio to re-sync the gradle files. This is really only an annoyance for when I tell it run my current code on a connected device. It builds fine, but it always tries to install and run an older (or missing after a clean) APK.
Is there a way, other than remembering to re-sync the gradle files, that would fix this? I feel like this used to work fine in older Android Studio releases.