INSTALL_FAILED_INVALID_APK
This error occurs when switching flavors & building a debug version after making a release version on my Pixel2 XL. The dialog asks to uninstall the existing application but the app is already gone on the device. It seems that there is a temp file triggering this flow again and again. Restarting Android studio / cleaning doesn't seem to help so my guess is it has something to do with Android O / my Pixel2 XL.
Any clues as to how to resolve this?