I have a program working in the Android Emulator. Every now and again I have been creating a signed .apk and exporting it to my HTC Desire to test. It has all been fine.
On my latest exported .apk I get the error message 'App not installed' when I try to install the .apk. It runs fine on the emulators.
As I have mainly been testing on the emulators and only every now and again exporting to a real phone I am not sure when this happened. What is the likely cause of it not installing on a physical phone but running fine in the emulators?
I have tried rebooting the phone & removing the existing .apk, does not fix the fault.
In my case, it's because Android Studio 3.0 sets
android:testOnly="true"
on APKs that build from therelease
Build Variant.So run
./gradlew assembleRelease
solve my issueMy problem was similar to that of @Lunatikzx. Because of wrong permission tag which was written as attribute to application:
What fixed it for me was changing permission tag to separate tag like this:
Primarily for older phones
I only encountered the
App not installed
error when trying to install an apk on my phone which runs on 4.4.2 aka KitKat, but my friend did not encounter this error on his phone which runs on 6+. I tried the other solutions such as removing the old/debug version of the app because the apk was a release version, clearing the debug app's data, and even clearing all of my cached data. Then, finally I realized all I had to do was select both signature versions when building my signed apk.Before I only had
V2 (Full APK Signature)
selected, but after selectingV1 Jar Signature
as well, I was able to successfully install my signed APK on my 4.4.2 device. Hope this helps others!In the end I found out that no apps were being installed successfully, not just mine. I set the Install App default from SD card to Automatic. That fixed it.
If you have a previous version for that application try to erase it first, now my problem was solved by that method.
Apparently this can also be caused by renaming the APK prior to installing it. I wanted to reduce the amount of typing users had to do to get the app from our web site by shortening the file name. After that, they were unable to install it.
Once I reverted to the original file name used when creating and signing the package I was able to update the installed app.