Search code examples
androidandroid-studioadb

Android Studio won't install app on Pixel 7 Pro


I've just upgraded to a Pixel 7 Pro from an HTX U12+ and am having problems testing my apps on the new phone.

Android Studio is 2022.2.1 Patch 2 running on Windows 11, with all of the latest Android SDK etc patches applied that have been offered.

The HTC U12+ is on Android 9 and the Pixel 7 Pro is on Android 13 with latest security updates installed.

My apps still install as debug or release version on the HTC phone, but when I try to install from Android Studio on the Pixel 7 Pro, the phone disconnects from Android Studio as soon as the install is attempted.

  • I have enabled Developer mode on the phone
  • I have enabled USB debugging
  • I have connected the phone and allowed USB file transfer (as I have always done on the HTC and other devices)
  • I have accepted the RSA fingerprint of the computer and selected to always allow this computer
  • The phone then appears in the Android Studio device drop down.
  • I click to run the app on the device and the build starts.
  • The build completes without problems.
  • Android Studio / ADB then tries to install the app on the phone and immediately the device dropdown in Android Studio reverts to one of my virtual devices.
  • The message in the Run window the immediately says that the "Installation did not succeed. The apploication could not be installed." and a little lower down sya sthat the "Installation failed due to: 'device {presumably device ID here} not found'.
  • Checking the devices drop down in Android Studio and the Pixel 7 Pro has disappeared.

If I disconnect the phone and reconnect it reappears in the drop down, but the same happens again if I try again.

I have tried de-authorising all debug/dev devices from the phone to forget the computer. I get the message to accept the RSA key again, but still the same problem.

I have even tried cleaning the project and rebuilding, deleting the intermediate files and the debig apk etc... but still the same result.

If I plug the HTC U12+ in and hit run it builds and installs without issue.

Obviously I can continue to use the HTC for testing, but that is stuck at Android 9 and I want to test on a physical Android 13 device before release. (I am already testing on Android 13 virtual devices).


Solution

  • It turns out that this was a USB-C port issue on the laptop.

    Not actually a fault on the port, but swapping to another port resolved the issue. A few days later the 'suspect' port was working again. How did I find the suspect port was working again? Well, the 'alternative' port displayed the exact same issue as the suspect port did originally.

    So, I didn't actually get to the bottom of why the problem occurred, but swapping to another USB port on teh laptop got me up and running.