484
votes

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.

30
When you say you've removed the existing .apk do you mean you uninstalled the application from the phone? If not, uninstall the application before trying to install it again.Telmo Marques
What TomS said, run adb uninstall your.package.name and then adb install /path/to.apk. I don't see why that wouldn't work. Have you changed anything in the signing procedure?Felix
Have you tried debugging it directly from eclipse in the device connected to the computer to see if the log says anything more?Javi
I did remove the app using the uninstall option from the application manager on the phone.Entropy1024
Felix. Where do I run this adb thing from?Entropy1024

30 Answers

290
votes

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.

enter image description here

Before I only had V2 (Full APK Signature) selected, but after selecting V1 Jar Signature as well, I was able to successfully install my signed APK on my 4.4.2 device. Hope this helps others!

215
votes

For me, On Android 9 (API 28), disabling Google Play Protect from play store app worked the trick, and i was able to get rid of the App not Installed error.

To disable Google Play Protect. Open "Play Store" application => tap on Menu button => select "Play Protect" option => Disable the options "Scan device for security threats".

181
votes

I had a similar issue and it was because I was trying to install an apk on a phone with a previous version of the same apk, and both apks hadn't been signed with the same certificate. I mean when I used the same certificate I was able to overwrite the previous installation, but when I changed the certificate between versions, the installation was not possible. Are you using the same certificate?

125
votes

Clearly there are many causes of this problem. For me the situation was this: I had deployed to my nexus 7 (actual device) from within the Android Studio (v1.3.2). All worked fine. I then created a signed apk and uploaded to my Google Drive. After disconnecting my nexus from the usb, I went to the settings/apps and uninstalled my app (App1). I then opened google drive and clicked on my App1.apk and chose to install it (need to ensure you have allowed installation of apks in settings). Then I got the dreaded message "App not Installed"

Solution for me: go back into settings/apps and scroll though all apps and at the bottom was a pale version of my App1 (note the original App1 was at the top in Alphabetical order which was deleted as above). When clicking on the pale version it said "Not installed for this user". (I had set up my nexus to have more than one user). But in the top right corner there is a three dot button. I pressed this and it said "Uninstall for all users". Which I did and it fixed the problem. I was now able to click on App1.apk and it installed fine without the error.

91
votes

I faced the issue when I update my android from 2.3.2 to 3.0.1 . If this is the case the IDE will automatically considers the following points.

1.You cannot install an app with android:testOnly="true" by conventional means, such as from an Android file manager or from a download off of a Web site

2.Android Studio sets android:testOnly="true" on APKs that are run from

if you run your app directly connecting the device to your system, apk will install and run no problem.

if you sent this apk by copy from build out put and debug folder it will never install in the device.

Solution :go Build ---> Build APK(s) ---> copy the apk file share to your team

then your problem will solve.

29
votes

I faced with the same problem. The problem was the main activity in my AndroidManifest.xml file was written twice. I deleted the duplicate.

21
votes

This can happen if you have your MainActivity declared twice in your AndroidManifest.xml.

Another possible reason: you changed the launch activity. Hint: never do it with already published applications! Reasons discussed in Android Developers blog.

20
votes

For those who are using Android Studio 3.

Suryanarayana Reddy's Answer is correct thought it doesn't state steps to solve it, hence.

in your AndroidManifest.xml under the application tag add testOnly="false" and android:debuggable="true" like so:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:testOnly="false"
    android:debuggable="true"
    >

Edit
then in AndroidStudio's menubar Build > Build APK(s)

18
votes

I had the same problem. I did not realise that an app must be signed even for testing.

After self signing it, it installed fine.

14
votes

I had the same problem and here is how solved it : Go to the Manifest file and make sure you have the "Debuggable" and the "Test Only" attributes set to false. It worked for me :)

13
votes

My problem was: I used the Debug Apk, that was generated while I did the Run command from Android Studio

Solution was: Instead of using this file, clean project and click Build > Build APK(s) from Android Studio. Then you can use the generated APK from the usual folder (app/build/outputs/apk/debug/)

The file that was generated like this installed without a problem.

12
votes

I know this is an old post, but for new users may be useful. I had the same problem: my application worked fine while debbuging. When I signed the APK I got the same message: "Application not installed".

I fixed that uninstalled my JDK (I was using jdk-6u14-windows-x64) and installed a new one (jdk-6u29-windows-x64). After export and sign the APK again, everything was ok!

Resuming, my problem was in JAVA version. Thank's Oracle!!

12
votes

My problem was that I have multiple user accounts on the device. I deleted the app on 1 account, but it still was installed on the other account. Thus the namespace collided and did not install. Uninstalling the app from all user fixed it for me.

10
votes

I faced a similar issue today and at first i thought it was my sd card which corrupted it. I tried it on many devices running android 4.4 and up but it kept bringing the same issue.After some googling and research i realized that i didn't select the v1 jar signature which is for devices older than android 7.0 nougat so i applied both of these signatures by selecting the two check boxes and generated a signed apk and it worked.

enter image description here

Link to solution Android – App not installed error when installing a signed APK – How to Fix

7
votes

If application's not installing, delete the file .android_secure/smdl2tmpl.asec from the SD card.

If the folder .android_secure is empty in the file manager, delete it from the PC.

7
votes

Sideloading debug apps for testing on a physical phone worked reliably until I upgraded the phone from Android Pie to Android 10. After that, the "App not installed" error came up every time I tried to sideload the app.

Based on a warning in my AndroidManifest.xml, I changed from...

<application
    android:name=".App"
    android:allowBackup="true" ... />

to...

<application
    android:name=".App"
    android:allowBackup="false" ... />

After that, I was able to sideload my app -- once. Then, I encountered the same "App not installed" error again. By changing allowBackup back to true, it worked again (at least once).

It is obvious from the number of answers and the variation in the answers that there are many reasons for this problem. I'm sharing this in case it helps others.

6
votes

If you have a previous version for that application try to erase it first, now my problem was solved by that method.

5
votes

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.

5
votes

I had the same issue, i.e. App showed up as being installed, but would not launched when the icon was tapped. After some head-banging, I found that I had stupidly placed ' android:exported="false" ' for my main launcher activity within the AndroidManifest file.... Once I removed it, the App launched fine..

5
votes

create keystore file through command line

keytool -genkey -alias key_file_name.keystore -keyalg RSA -validity 1000000000000000 -keystore key_file_name.keystore

export apk through Eclipse, right click on Android project Android Tools > Export Signed Application Package, then give keystore location & password.

this will crate signed apk at the same time apk will be zipaligned. And installable.

If you go through command line for all, some times you may face "Application not installed" error. (Application not installed error can happen not only, when using command line. It can be some other reasons as well)

5
votes

ARGHHHHH! I was trying to install as Unsigned Release APK when the proper setting was DEBUG SDK.

There goes an hour.

5
votes

I have also solved this issue,

The problem was that i declared my main activity twice, On as the first activity to load and i specified also an intent-filter for it And once again below it i declared it again .

Just make sure you don't declare your activities twice .

4
votes

My problem was similar to that of @Lunatikzx. Because of wrong permission tag which was written as attribute to application:

<application
    android:permission="android.permission.WRITE_EXTERNAL_STORAGE"
    android:label="@string/app_name"
    android:icon="@drawable/ic_launcher"
    android:testOnly="false"
    android:debuggable="true">

What fixed it for me was changing permission tag to separate tag like this:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
4
votes

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.

4
votes

In my case it was because I was using the alpha version of support library 28. Looks like Google marks these pre release versions as testOnly. If you really want to release like this (for instance, you want to push an internal beta like I did), you can add this line to your gradle.properties file:

android.injected.testOnly=false
3
votes

Check with the Android version.

If you are installing non-market apps, and incompatible version you will get this error.

Ex: Application targetted to 2.3.4 Your device is 2.2 Then you will get this error.

3
votes

The "Application not installed" error can also occur if the app has been installed to or moved to the SD card, and then the USB cable has been connected, causing the SD card to unmount.

Turning off USB storage or moving the app back to internal storage would fix the issue in this case.

3
votes

I also encountered this issue. Kindly try this solution. Make sure that the package name of your project is different from your previous project that was already installed in your mobile phone. I think they get conflict in their names. It works in me.

3
votes

You also may encounter this issue because your device manufacturer did not license the Google commercial apps, such as Play Store, YouTube, Google Maps, etc. Follow this answer to solve the problem.

3
votes

This can also occur when making a home screen widget, and your widget XML file has an incorrect Activity specified in its android:configure property.