84

I'm trying to install an APK on a device running an AOSP build of Jelly Bean (4.2).

When I "adb install my.apk", I get the error:

[INSTALL_FAILED_VERIFICATION_FAILURE]

I've tried using "testsign.jar" to "sign" the apk but it does not change the outcome

dcarr622
  • 1,576
  • 4
  • 15
  • 23

15 Answers15

120

You need to disable verification of the APK during ADB install. If the setting in Security is greyed out or isn't working as it should try shelling into the device and, depending on which settings database the setting is in per your API level (Global, System, Secure) run

$ adb shell settings put global verifier_verify_adb_installs 0

If you can actually set it, it will prevent checking of APKs over ADB.

Sometimes you will need to disable the package verifier as well using:

$ adb shell settings put global package_verifier_enable 0

On KitKat, you can see here that these settings are in the Global database:

http://androidxref.com/4.4.2_r2/xref/frameworks/base/core/java/android/provider/Settings.java#5015

Reuben Tanner
  • 5,229
  • 3
  • 31
  • 46
  • This is helpful but is missing where exactly I needed to put in that command. Thanks to [this answer](http://stackoverflow.com/a/42711665/1276636) I found the missing step. – Sufian Mar 10 '17 at 15:16
  • 3
    Could you please explain what does "verify APK" means here? Is it signature verification? My app seems to have a one (And there is not any apk without any signature I think) – Saleh Feb 05 '20 at 21:40
  • 2
    "Verification" also requires network, so if you have airplane mode turned on, it will also fail. – mjs Jun 05 '20 at 12:04
79

Go to developer settings and disable verify apps via USB. Then you can install .apk without any problem.

Prashant_M
  • 2,868
  • 1
  • 31
  • 24
Abdul Hafeez
  • 791
  • 5
  • 2
51

In your phone,Go to:

setting/DeveloperOption/verify apps over USB

and disable it.

Maryam Azhdari
  • 1,161
  • 11
  • 8
  • 2
    How is this answer different to [this one](https://stackoverflow.com/a/51154492/9209546)? – jpp Dec 20 '18 at 00:48
37

This what worked for, I was trying to install on device with android 6.0

  1. Settings > Developer Options > Then Turn off Verify Apps over USB See first image

Then

  1. Settings > Security > Then Turn on Unknown sources

Finally

  1. Do not forget to uninstall your app and start afresh.

Got to Settings > Developer Options > Then Turn off Verify Apps over

Settings > Security > Then Turn on Unknown sources

Reuben Tanner
  • 5,229
  • 3
  • 31
  • 46
Gpak
  • 3,342
  • 2
  • 21
  • 19
  • Worked for me. Only step 1 is insufficient, step 2 is also needed. This is the correct answer. – Haomin May 06 '19 at 19:45
11

The actual problem is Google play block your app! You need to turn off that

  1. Go to the play store
  2. Open the drawer and select Play Protect
  3. Open the settings and turn off both Scan apps with play protect and Improve harmful app detection
  4. Now it's your turn. Rebuild your app and launch it! Good Luck!
Mahinthan177
  • 774
  • 1
  • 9
  • 9
9

UPDATED ANSWER: with the last Android updates, now the following error may show during installation of the APK because of Play Protect:

Failed to finalize session : INSTALL_FAILED_VERIFICATION_FAILURE
Session 'app': Error Installing APKs

In order to fix this (for developer purposes), you may disable Play Protect as it is shown here: installation app blocked by play protect.

juliancrg
  • 151
  • 2
  • 8
5

You have to allow unsigned applications. The install is being blocked by Android. Allow install of non-market apps in Settings.

StackExchange User
  • 1,222
  • 14
  • 35
apollosoftware.org
  • 12,161
  • 4
  • 48
  • 69
4

Aside from "settings put global verifier_verify_adb_installs 0", I also need to set package_verifier_enable to 0 in my case to make it work.

e.g.

adb shell

settings put global package_verifier_enable 0
lordhong
  • 1,227
  • 1
  • 12
  • 19
2

delete all directory -> {.gradle, .idea, app/build } and install again working for me

Amar Singh
  • 435
  • 5
  • 9
1

None of the suggestions above worked for me, however factory resetting the device did the trick.

Misha
  • 693
  • 5
  • 14
0

As someone said, you need to have a signed apk to run it.In order to have a signed apk, right click on your project>Android tools>Export signed application package.You will then be prompted to locate your keystore, but if you don't have you can create one.Follow the next steps as guided by eclipse.

0

You can do this without any instructions like this: Go to settings on your device and then develooper setting and disable the option to confirm apps via usb. (Translation with google translate)

0

This happened to me in Android Studio after I reinstalled the OS on my PC - I was trying to test a build on a tablet. What ended up working for me was simply uninstalling the application on the tablet (built by the previous installation).

Tymek
  • 664
  • 7
  • 8
0

turning on app debug in developer settings solved my problem

medard mandane
  • 549
  • 4
  • 6
  • could you be a bit more specific as how to do that? I don't see anything that says "app debug" under developer settings. the closest I see is "Debugging > Select debug app" which doesn't pop up anything helpful. – Michael Jul 12 '22 at 23:30
0

I faced this issue, for me it was because the developer's option was not enabled for my emulator. you can enable it from settings as we do for real devices.

Muhammad Umair Saqib
  • 1,287
  • 1
  • 9
  • 20