The reason is that the ADB does not detect devices (including real and virtual machines).
Perform the ADB devices command in terminal to see if there are any devices connected to it.
1. If you do not have a device, verify that the virtual machine is turned on correctly, and that the connection turns on USB debugging and installs the driver. Perform both the ADB kill-server and adb start-server commands to restart ADB.
2. If you have a device, select Run->editconfiguration->general, View the deployment Target options, see if there is a problem with the settings taget, and if use same is selected Device for the future launches option.
The 3.Target three options represent the Open device selection box, USB device, virtual machine, respectively. If the second item is set, then opening the virtual machine will prompt no target device found.
Androidstudio Run Program tip error running App:no target device found