skip to Main Content

I am new to Kotlin, and currently building my very first app (I am not experienced at all on the topic).

I successfully managed to customize my android phone and my android studio and achieved to launch the app I am currently working on a few times.

However, I now run into an error when trying to launch my app on my physical device. I get the following message: "Couldn’t terminate the existing process for com.example.diceroller.", as if it was still running. The icons to launch/stop the app also seem to be in a state where the app is running on the device.

enter image description here

I have tried the following, without result:

  • close all running apps on the phone
  • reboot the phone
  • restart Android Studio
  • deactivate/reactivate USB debugging on the phone

The app does work fine on a virtual device.

Could you please give me any lead to follow to try and be able to test my app on a physical device? Thanks a lot!

2

Answers


  1. Try to kill the daemon, open your terminal and write this

    adb kill-server
    
    Login or Signup to reply.
  2. Thanks to @Pierre Masse for posting the question in a detailed format, which made it easier for me to identify that I was facing the exact same issue.

    I tried all the steps in the same order as mentioned by @Pierre Masse, however the outcome remained the same (unsuccessful).

    I also followed the solution posted by @Muhammad Rio, unfortunately this too didn’t work in my case.

    This is how I resolved the issue.

    • Delete the physical device from the Android studio Device Manager (When the phone isn’t connected).
    • Deactivate USB debugging on the phone.
    • Now reconnect the phone using the USB cable where it is detected by the computerlaptopMac as a normal device (StorageUSB charging)
    • Now reactivate USB debugging on the phone.
    • Once the phone is listed again under physical devices in Android Studio Manager, run the app. It should run normally.

    Thought of sharing this, so that a beginner like me doesn’t get demotivated at the first roadblock in his mobile development journey.

    Cheers to both Pierre and Muhammad for their inputs.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search