Failure [INSTALL_FAILED_USER_RESTRICTED: Invalid apk] in android

Unnati Patadia picture Unnati Patadia · Apr 4, 2018 · Viewed 8.8k times · Source

I am using Android Studio 3.0.1.
When i am trying to run app

INSTALL_FAILED_USER_RESTRICTED: Invalid apk

error occurs.

I also disable Instant Run.

enter image description here

again i am run app but same error occurs.

04/04 10:59:08: Launching app
$ adb push G:\Android\Fundraiser\BuyForFund\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/com.android.buyforfund
$ adb shell pm install -t -r "/data/local/tmp/com.android.buyforfund"
Failure [INSTALL_FAILED_USER_RESTRICTED: Invalid apk]

$ adb shell pm uninstall com.android.buyforfund
DELETE_FAILED_INTERNAL_ERROR
Error while Installing APK

Answer

user3630061 picture user3630061 · Apr 28, 2018

I have the same problem, I sent a feedback to Google on my phone, would say it's a bug. In my case the best solution is to cancel that dialog and then re-run, it works always on second attempt after cancelling.

Depending on what phone you are using, I would assume the problem is on the phone (Google) side. Not sure yet if a general Google problem or specific hardware phones, I use "Xiaomi Redmi 5".

Disabling instant run actually worked in my case, but that's not the purpose of it, that's just a dirty workaround.

Edit: Make sure that you don't have something like

android:debuggable="false"

in your manifest.