3

INSTALL_FAILED_INVALID_APK

This error occurs when switching flavors & building a debug version after making a release version on my Pixel2 XL. The dialog asks to uninstall the existing application but the app is already gone on the device. It seems that there is a temp file triggering this flow again and again. Restarting Android studio / cleaning doesn't seem to help so my guess is it has something to do with Android O / my Pixel2 XL.

enter image description here

Any clues as to how to resolve this?

Jordy
  • 1,624
  • 1
  • 19
  • 30

5 Answers5

3

You can goto AndroidStudio Setting ,and Search "Instant Run" , and close it.

GreatJohn
  • 41
  • 6
0

I have experienced the same issue before. You can simply restart android device and try again. It will work.

Yuichi Akiyoshi
  • 379
  • 4
  • 18
  • This actually did the trick for me, I did increase the version number so that was not the issue in this case. What exactly caused this is still unclear to me. – Jordy Jan 03 '18 at 17:38
0

You cannot install older version over newer version (i.e. 5 over 7), only newer over older. So, you either need to increase your version code or uninstall the app before installing (what Android Studio suggests).

Anton Malyshev
  • 8,035
  • 2
  • 23
  • 41
0

You may not have that android version of your Pixel 2 in your Android Studio.

According to the screenshot, you have to add that android version to your Android Studio.

See this link: Changing API level Android Studio

Ronnie Oosting
  • 1,196
  • 1
  • 11
  • 32
Chek Choi
  • 1
  • 3
  • Can you provide a solution for OP? – Ronnie Oosting Dec 21 '17 at 11:55
  • if you don't have the corresponding API Level already: https://stackoverflow.com/questions/19465049/changing-api-level-android-studio If you only have Problem with the Version Name or Version code, then probably: https://developer.android.com/studio/publish/versioning.html#minsdkversion – Chek Choi Dec 21 '17 at 12:07
0

you can try to use adb install xxx.apk

if not working , try adb uninstall your-package-name

nick zhou
  • 21
  • 6