The application is a system application, and it will be started by other applications. When I install the application from android studio 4.2 or Arctic Fox, it fails with "Couldn't terminate the existing process for" error message. When android studio terminate the app, other app listen ServiceDisonnected and will bind service again, so the app will restart. Installing from the commandline by adb install command or Android studio 4.1.3 works well.
I have Android Studio Electric Eel | 2022.1.1 Patch 1. The only 2 temporary solutions that have worked for me are:
- Uninstall the application and then invalidate the project cache (File/Invalidate caches).
- (Only for physical devices) Uninstall the application and then disconnect the USB cable, you must make sure that Android detects this connection and disconnection.
It's because you ran in debug mode or attach debugger and that process is not killed perfectly.
Follow the following to resolve this issue.
- Press "Attach Debugger to Android Process" button
- "Choose Process" dialog will be shown and the application name is listed, press "OK"
- Check the "Debug" tab console, when it says "Connected to the target VM, address: 'localhost:60245', transport: 'socket'"
- Press the "Debug" Button.
- Device will relaunch the app with latest changes
- Now stop from red button in the android studio menu bar. And run app again as normal
Enjoy !!
In my case, I just restarted the device, then Android Studio could launch the app normally.
Or you could try: gradlew --stop
This will stop all running daemons
The following fixed this for me on a physical device:
- Connect phone to PC using a USB cable and enable USB debugging.
- Run
adb shell cmd package list packages
to find package name (use| findstr /c:"foo"
to filter the output). - Uninstall the app from the phone using
adb uninstall adb uninstall com.my.app
(replacecom.my.app
with your actual app name). - Rerun the app from Android Studio using Shift+F10.
Note that in my case I couldn't see the app on the phone's UI. Only adb
was able to detect the app.
I work with a physical device but simply reconnecting the cable to my phone worked for me. So before you do any uninstalling, might wanna try the easiest solution.
After 10 wasted minutes I remembered the basic engineering rule: Pull the plug.
In practice: Restarting Android Studio fixed it for me.
© 2022 - 2025 — McMap. All rights reserved.
Run
window from Android Studio. – Floorer