Android: Error while installing APKs

Follow these steps to overcome the issue.

  1. Disconnect all devices connected to system, and close all emulators running on System.
  2. Turn off Instant Run feature from settings.
  3. Perform a clean build.
  4. Turn on Instant Run feature from settings.
  5. Perform a clean build.
  6. Connect your device/start your emulator and ensure it is online.
  7. Run the project by selecting the device/emulator.

Note:

1) You should not have different instances of Android Debug Bridge(adb) running on system.

2) If using Genymotion then make sure that you use the custom sdk path mentioned in the Genymotion settings the which you mentioned in the settings of Android Studio.

These steps are likely to solve your issue, however it may also be a problem with android versions.


For Redmi and Mi devices turn off MIUI Optimization and reboot your phone.

Settings > Additional Settings > Developer Options > MIUI Optimization

Check Answer here


Turn off the Instant Run in Android Studio. Follow the steps below:

  1. File >> Settings >> Build, Execution, Deployment.

  2. Click on Instant Run and unckeck "Enable Instant Run to hot swap code/resource changes on deploy".

  3. Click on "Apply" and "OK".

Try running the application again. It should install the app now. You can re enable Instant Run again anytime.

EDIT (Android Studio 3.0)

Disable Instant Run (Android Document)

To disable Instant Run:

  1. Open the Settings or Preferences dialog. (For Mac, Android Studio -> Preferences)
  2. Navigate to Build, Execution, Deployment > Instant Run.
  3. Uncheck the box next to Enable Instant Run.