'Show correct Bubble in Android Studio when nothing has been deployed

I repeatedly run into the problem, that Android Studio is not deploying the app on the mobile device.

When I hit the play button it shows the following message in the 'Run'-Tab:

02/16 12:08:06: Launching 'App' on Physical Device.
Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: No outputs for the main artifact of variant: debug

Normally, I can fix this by hitting the "Sync project with gradle files"-Button or just trying to deploy again. So this is not the main problem.

The annoying part is, that Android Studio shows the green "Success. Operation succeeded"-Bubble next to the run tab, even if nothing was deployed to the device.

Is this a problem in the IDE? Can it somehow be configured to show an error instead?

I am using Android Studio 4.1.2



Solution 1:[1]

run -> edit configuration -> before launch

click on add button and select gradle-aware make then press apply and then OK

by above step my app run successful

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 Hardik raiyani