Android Studio: Application Installation Failed

I've been trying to learn how to use Android Studio but when I attempted to run one of the sample programs I get this error message:

Installation failed with message null. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

I've tried to do this on 5 more sample programs and all of them give me this error. Does anyone know how to solve this?


Solution 1:

I'm Using Redmi 3s mobile. I got same problem.

Solution: This issue is common on Xiaomi phones running MIUI 8. This can resolved by turning off MIUI optimizations from Developer Options in Settings app. Then recompile the app and voila it works.

Settings --> Additional settings --> Developer options --> Turn Off MIUI optimization

Or

Settings --> Developer options --> Turn Off MIUI optimization

Solution 2:

I got the same problem , just choose clean project then rebuild project from build menu , it's solved my problem

Solution 3:

Disable Instant Run

Preferences > Build, Execution, Deployment > Instant Run

Source: comment by @user77309

enter image description here

Solution 4:

Path: Android Studio Preference / Build, Execution, Deployment / Instant Run

Go to Android Studio Preference (for Mac) or Settings (for windows)

Choose Build, Execution, Deployment tab

Choose Instant Run

Uncheck Enable Instant Run to hot swap code/resources changes on deply (default enabled)

It works for me!!