When I first start Android Studio opening an existing project, and click Run, I get the error message Error running app, No target device found.
I have my Samsung plugged in and ADB debugging enabled. It correctly shows up with the adb devices command and ADB shell works fine. I tried adb start-server with no joy. Strangely, If I start 'Debug app' first and then 'Run' it works fine, but I don't understand why this annoying step is necessary. Other StackOverflow answers said to do "Edit Configurations" but that doesn't show the options suggested. I'm running AS V3.01. Any clue?
Asked
Active
Viewed 3.1k times
4
EL TEGANI MOHAMED HAMAD GABIR
- 1,862
- 2
- 17
- 31
DontPanic
- 1,936
- 5
- 25
- 50
-
`Strangely, If I start 'Debug app' first and then 'Run' it works fine` what do you mean? – Sagar May 18 '18 at 15:08
-
Did you waited a time so adb started while no devices apear? – Marcos Vasconcelos May 18 '18 at 20:23
-
1Yes I waited plenty. And the device *always* appears. But still no joy. – DontPanic May 19 '18 at 20:35
-
in my case that was because of Platform-Tools. check my solution here : https://stackoverflow.com/questions/40022679/android-studio-no-target-device-found/71219257#:~:text=In%20my%20case%20that%20was%20because%20of%20Platform%2DTools.%20I%20updated%20that%20and%20solved.%20path%3A%20File%20%7C%20Settings%20%7C%20Appearance%20%26%20Behavior%20%7C%20System%20Settings%20%7C%20Android%20SDK%20%2D%3E%20Android%20SDK%20Platform%2DTools – Sadegh Feb 22 '22 at 10:06
2 Answers
16
I found my problem. Under Run->EditConfigurations->DeploymentTargetOptions, I selected USB Device (my phone is a USB device, right?). But noooo, when I select Open Select Deployment Target Dialog, everything is peachy. Also, checking Use same device for future launches bypasses the dialog entirely and all is good.
DontPanic
- 1,936
- 5
- 25
- 50
-
Exactly the same issue, and exactly this solution worked for me. StackoverFlow is great! – Raghav Sep 25 '18 at 03:47
-
1If you don't see the `DeploymentTargetOptions` and do have an emulated device created, try restarting Android Studio and it should show up. – lasec0203 Sep 08 '19 at 05:52
0
Check USB connection. Might be device is not connected properly.
Enable USB debugging mode on Device How to enable USB debugging in Android?
- Select your device in tool bar and click on play button(Run application).
Ashvin Patel
- 73
- 6