8

enter image description hereThe 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.

Zero
  • 426
  • 1
  • 4
  • 6
  • 2
    Please add more info related to the error, such as a screenshot of your `Run` window from Android Studio. – Jay Aug 02 '21 at 05:55
  • 1
    More likely that you're trying to update already installed app but as it is system app - adb doesn't have proper privileges and can't close already running process. Quick solution - manually uninstall your app, then install it again. One more thing - if you're developing system app - to be sure that you app behaves as expected - you should install it in system apps directory with proper Linux permissions (644 if I'm not mistaken). Under installation I mean just placing apk to system apps directory, granting permissions and rebooting device. – Arthur Aug 02 '21 at 06:05
  • 2
    Thank you for answer. It is a system app , only updates can be uninstalled . – Zero Aug 02 '21 at 06:20
  • Is the problem solved? Try to create a new device otherwise! – Cactusroot Aug 02 '21 at 07:50
  • 2
    Not yet, I found the same issue at https://issuetracker.google.com/issues/181004316 – Zero Aug 02 '21 at 08:22
  • Looks like it's about to be patched in the next update for Android Studio: "We have a fix ready for the next patch of Bumble Bee." – Chucky Feb 10 '22 at 12:44
  • Uninstall the app and run again work for me! – Mohamad Ghaith Alzin Jun 22 '22 at 05:26
  • Restart your device – Marcos Dávalos Feb 07 '23 at 00:27

2 Answers2

2

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.

  1. Press "Attach Debugger to Android Process" button
  2. "Choose Process" dialog will be shown and the application name is listed, press "OK"
  3. Check the "Debug" tab console, when it says "Connected to the target VM, address: 'localhost:60245', transport: 'socket'"
  4. Press the "Debug" Button.
  5. Device will relaunch the app with latest changes
  6. Now stop from red button in the android studio menu bar. And run app again as normal

Enjoy !!

Sajid Zeb
  • 1,806
  • 18
  • 32
-1

Go to Setting -> Build,Excution,Deployment -> Debugger, under Android Debug Bridge tab, uncheck "Enable adb mDNS for wireless debugging", and done !

Majid Sadeghi
  • 180
  • 11