Question: I want to fetch the clientroot of perforce in a perl script.

I wrote the code as :

```
my $workspace_root=system("p4 client -o | findstr /b Root");
print $workspace_root;

```

Instead of printing the path, it prints `0`

Could anyone please tell what I am missing here?

Answer: 
**Note:** The top answers recommend to **disable Instant Run**. Try this before exploring my listed solutions to prevent wasting more time than needed.

Here are some possible solutions:

**1) Make sure that your phone is properly connected to your PC with a USB cable:** Before going over these fixes, make sure that you have at least connected your phone to your computer properly. If it's properly connected, your phone should be charging.

**2) Make sure that your device's driver software is up-to-date:** Simply go to your File Explorer and then right click `Computer`. Then, select `Manage` (requires administrator privileges). In your Computer Management window, find a tab on the left pane that says `Device` or `Device Manager`. Search for your device from there. Mine was under `Portable Devices` and the name started with `SAMSUNG`, so finding your device shouldn't be too hard. Right click the device, and then select `Update Driver Software...`. I chose the `Search automatically for updated driver software` option, since it's much easier. 

**3) Enable `USB debugging` under your `Developer Options`:** For my Samsung Galaxy S9, I found mine under `Settings` > `Developer Options`. From there, enable `USB Debugging`. If you can't find your Developer Options, find your build number within the settings and tap it 7 times consecutively. I found mine under `Settings` > `About Phone` > `Software information`.

**4) Make sure you've allowed USB debugging for your specific computer:** Although you may have your `USB Debugging` option enabled, you still need to allow USB debugging for your specific computer. A popup should appear asking `Allow USB debugging?` and providing the computer's RSA key fingerprint. Before pressing OK, make sure your check `Always allow from this computer`, so that you don't have to go through this again in the future. **If you think you've done this but yet your device is still marked as `OFFLINE`**, select the `Revoke USB debugging authorization` option in 'Developer Options'. Then, re-allow your computer for USB Debugging. If the popup doesn't appear, reconnect your phone to the Computer (pull the cable out and put it back into your Phone).

**5) Trying cleaning AND rebuilding your project:** In Android Studio, open up the `Build` tab at the top left and try both the `Clean` and `Rebuild` options.

**If none of the above works out:** Reinstall Android Studio by Uninstalling the program and re-downloading the setup file [here](https://developer.android.com/studio/index.html). Scan for any viruses that may be affecting your computer. Check for any sort of error while reinstalling Android Studio. If none of the methods presented in this answer work, fetch for support [here](https://developer.android.com/support.html).

Good luck.
After trying the different solutions from the different answers, I tried changing the USB debugging cable, and the problem resolved finally.