I am using Android Studio 2.2 Preview. I am facing the issue
Failure: Install failed invalid apk
Error: While installing apk,
When i try create another package
under the Java folder
this error will happen
But When i moved this special package under the main package
of my project , everything will be ok .
I'm testing on real android device .(Sumsung J2)
If your device is a Xiaomi the answer is:
Go to settings > installed apps > on the top choose "ALL" > go to the bottom find "Documents" app (its in bottom because disabled) > enable it with pressing enable on the bottom screen...
edit: I was used Android Studio 2.3 at the time
I encountered a similar problem, I moved the project directory, resulting in installation failure, my solution is as follows: Build->ReBuild
I also had the same problem, I tried the solution to disable the instant run, but you can not use the instant run, which for me is harmful, because it is an extremely useful tool.
I found another solution, which is to delete the "build" folder and re-run the project, and the error disappears, the app is executed and I can use the instant run.
I just updated minSdkVersion to 17 and sync. And then I solved that problem.
in the build.gradle(Module:app), Change like below.
defaultConfig {
...
minSdkVersion 17
...
}
You need rebuild the project
If using Android Studio 2.3:
Build -> Rebuild Project
Even if after that your app start with a error just rebuild the project again:
Build -> Rebuild Project