I am using Android Studio 2.2 Preview. I am facing the issue
Failure: Install failed invalid apk
Error: While installing apk,
In Android Studio 2.3
Disable Instant Run
Settings>Build, Execution, Deployment>Instant Run
Source: comment by @Shubham A.
Edit: To Disable Instant run
In Windows:
Control + Shift + A
. instant run
and open instant run
under settings
.Enable instant run...
In Mac: I don't have a mac, so try like
Command + Shift + A
. instant run
and open instant run
under settings
.Enable instant run...
Android studio mac/windows/linux:
Steps in together (mac): Android Studio > Preferences > Build, Execution, Deployment > Instant Run > Uncheck : Enable Instant Run
Steps in together (windows & linux): File > Settings > Build, Execution, Deployment > Instant Run > Uncheck : Enable Instant Run
Steps in Detail :
Steps 1: Studio > Preferences (for windows & linux got to File > settings > Build, Execution, Deployment and then same as mac)
Steps 2: Preferences > Build, Execution, Deployment
Steps 3: Build, Execution, Deployment > Instant Run
Steps 4: Instant Run > Uncheck : Enable Instant Run
For Xiaomi mobile
1.Setting=>About phone=>tap 7 times on MIUI version
2.Setting=>Developer options=> Developer options (ON)
=> USB Debugging (ON)
=> Install via USB(ON)
Install via USB
if
enable to ON then
Disable WiFi and switch install via USB on while you are connected through mobile data and under your xiaomi account. It works!
I have solved this issue by:
In Device Developer option
Check Install Via USB is ON compulsory.
Before you run any android app on a phone for the first time, make sure that you don't forget to set the Install via USB option. Otherwise the above error will be reported.