526

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.

BartoszKP
  • 34,786
  • 15
  • 102
  • 130
Entropy1024
  • 7,847
  • 9
  • 30
  • 32
  • 6
    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 Nov 19 '10 at 14:57
  • 10
    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 Nov 19 '10 at 15:12
  • 2
    Have you tried debugging it directly from eclipse in the device connected to the computer to see if the log says anything more? – Javi Nov 19 '10 at 16:29
  • 2
    I did remove the app using the uninstall option from the application manager on the phone. – Entropy1024 Nov 19 '10 at 16:43
  • Felix. Where do I run this adb thing from? – Entropy1024 Nov 19 '10 at 16:44
  • @Entrepy1024 from the tools folder in the android sdk folder. Here more info about adb: http://developer.android.com/guide/developing/tools/adb.html – Javi Nov 19 '10 at 16:46
  • Javi. I have never had the device connected to the PC. I have always worked by exporting a signed apk and dropping it into dropbox then getting it out of dropbox on the phone. Has worked well for me for weeks. Will try connecting via USB though, thanks. – Entropy1024 Nov 19 '10 at 16:46
  • That sounds like a terrible way to do it... Plug the phone in and you can click run from eclipse and it will install it directly. – Falmarri Nov 19 '10 at 20:04
  • What do you use as developing tool? In Flash Builder you have to set "Export application with captive runtime". I ask this because your app size is small for an Flash Mobile App. For example, when I deploy an app without these runtime libs it is less than 1 MB and with this runtime it is about 9 MB. – Codebeat May 24 '12 at 23:07
  • I have same issue, in my care, new apk version code is less the already installed application. As I changed +1 version code to new apk, It works fine. – Ashish Dwivedi Jul 17 '14 at 10:22
  • see my answer here http://stackoverflow.com/a/36705562/3578171 its probably what you are looking for. – Dmila Ram Apr 18 '16 at 22:45
  • This answer may help to someone, https://stackoverflow.com/a/44387533/1404798 – Thirumalvalavan Oct 23 '17 at 14:47
  • In my case it was play protected. When I disabled play protection I can install apk on device. – chetan Jul 26 '18 at 10:51
  • In my case, the issue is caused by versioncode of the existing app is higher than the new/updated app. – ekouChiq Oct 05 '18 at 13:15
  • In case, you're trying to test the newer release version of your app: https://stackoverflow.com/a/60585224/5115696 – Abduaziz Kayumov Jun 01 '20 at 06:11
  • make sure to check in `AndroidManifest` file under `application` tag, `android:testOnly` is set to "false". – CHIRAG SAHU Apr 30 '22 at 11:04
  • I was unable to open the app from the home screen but opening it via `settings->apps->all-apps->myapp->open` worked. – Souleste Sep 13 '22 at 20:23
  • Turns out i didn't had memory on my device ! Had to free some ... – Sanmeet Jan 15 '23 at 15:59

66 Answers66

296

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.

starball
  • 20,030
  • 7
  • 43
  • 238
Chris Gong
  • 8,031
  • 4
  • 30
  • 51
  • 6
    Take in account this solution when you have an older phone! I have a Galaxy S4 mini with Android 4.4.2 and I forgot to check the "V1 signature" so it cannot install in the device. After checked, the apk gets installed like a charm. – Jose Ramon Garcia Mar 09 '17 at 23:25
  • 1
    Thank you! Android Studio should give more information about this when signing the application, or make it more obvious what it does when you don't tick `V1 (Jar Signature)` – melledijkstra Jan 16 '18 at 15:50
  • In my case i have to add this configuration into manifesto file android:installLocation="internalOnly" – avinash kumar Mar 28 '18 at 17:20
  • 1
    I originally signed with v2 when I ran into the problem. Then I signed with v1 only and then it worked. I'm running sdk23 on my phone. – Amber Jun 05 '19 at 16:10
  • This is the correct answer, also necessary for newer Phones (Oreo) – ueen Jun 25 '19 at 09:41
  • 1
    Thanks for mentioning "clearing debug app's data". That helped me – Meet Zaveri Jan 12 '21 at 11:06
228

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".

Qasim
  • 5,181
  • 4
  • 30
  • 51
  • 7
    even though when i first tried to install my app, i was prompted by play protect saying it couldn't verify the app was safe, and i did press "install anyway" the app still would not install. this override worked – user2565663 Feb 15 '19 at 21:19
  • I don't have the Play Store in the Android emulator (API 28). – Jerry Dodge Mar 07 '19 at 22:07
  • 3
    Also the case on Android 8 (just to complete the reported gap between 7 and 9). – cleardemon Mar 25 '19 at 17:00
  • 4
    This works fine. Don't forget to revert the settings once installed apk. – Rahamath Mar 28 '19 at 14:33
  • Thanks a lot, solved problems on my Xiaomi Redmi 5 Plus – Nicola Gallazzi Apr 11 '19 at 19:10
  • This worked for me, THANKS. I had an app that I installed no problem. I made a copy of the application and added some minor modifications to allow NFC reading and the new version wouldn't install. This fixed it for me! – Smitty-Werben-Jager-Manjenson Apr 22 '19 at 15:30
  • 3
    Absolutely ludicrous, but it worked. I had installed my APK a good 6 times this morning and _every_ time it prompted me whether I really wanted to install despite it not being recognized by Play Store or whatever. And then suddenly it stopped prompting me and instead decided to fail with an unhelpful message. This got me around it. – me-- May 13 '19 at 00:18
  • Worked on Pocophone F1 – FabioR Jul 09 '19 at 18:07
  • Solid fix for my Android 9 (Samsung Galaxy A8) in 2019. Thanks – Tom Truyen Aug 28 '19 at 18:46
  • Worked on Android 8.1, Samsung J530F – Hamza Waleed Sep 12 '19 at 06:39
  • there should be a play protect popup when youre installing the app. However, the popup will not show at all if there is anything that is overlaying on the screen. For example, the Lux app which changes the device brightness automatically will prevent the popup from showing unless you "sleep" it – user99999991 Feb 13 '20 at 01:27
  • 4
    This, plus removing the existing app, solved the problem for me. – Meekohi Nov 18 '20 at 01:27
191

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?

the-drew
  • 93
  • 8
Javi
  • 19,387
  • 30
  • 102
  • 135
  • 10
    Yes it is the same certificate. I think I had that once before. I have tried deleting the existing app on the phone and have also tried installing an un-signed version. Still get the same error message. – Entropy1024 Nov 19 '10 at 16:24
  • 2
    I also had the same issue for that (previous version with other certificate) - to be specific, I had it implicitly installed for using the debugger. Revmoving solved it (not your case, as seen below, but worth registering here) – chesterbr Nov 29 '10 at 02:35
  • 29
    This post has more than 30 answers. What I recommend is, Whenever you face this issue, Observe device logs while installing the app. use adb logcat. You will get to know exact cause of the installation failure. log for my issue is "Package com.companyname.appname signatures do not match the previously installed version; ignoring!" – Manikandan Jan 07 '18 at 17:36
  • I changed package name. and it worked. I realized I had tested multiple apps with the same package name so the error. – user30478 Nov 30 '19 at 09:30
  • In my case, I had to uninstall previous version, restart my phone, and install the next version. – Onat Korucu May 22 '21 at 22:05
  • 1
    Yup! I was trying the install a signed release apk when I had a debug build of the app installed on my phone – Touré Holder Apr 30 '22 at 21:09
129

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.

Astra Bear
  • 2,646
  • 1
  • 20
  • 27
  • 1
    has same issue. I had a guest account activated and when removing the app, it did not remove from all users. – Filip Luchianenco Jul 16 '16 at 23:05
  • 1
    I really appreciate if you can provide some screenshots – mstar0125 Sep 20 '16 at 14:25
  • @mstar0125 I don't have that environment set up any more so can't do screenshot. Is there a specific question I can help with? – Astra Bear Sep 22 '16 at 08:06
  • 2
    Thanks. I also ran into this issue. It is absolutely not obvious, the first time, that uninstalling the app only does it for the current active user. To avoid going into the settings every time, I use the command `adb uninstall your.package.name` that does uninstall for all users. – Xavier Sep 18 '18 at 07:59
  • 1
    This had saved me after spending around hours researching. The UI of the Settings is a bit misleading, I had never noticed that 3 dots before reading this post. – ZZZ Sep 23 '18 at 08:41
  • 1
    What is an Android version? 6.0? – CoolMind Oct 15 '18 at 13:22
  • It was a while ago so about Android V4.23 when I first posted. But seems to have persisted through many later versions as evidenced by comments above. – Astra Bear Oct 15 '18 at 23:04
  • Still an issue on android 11. I think I "uninstalled" the app the way I'm used to, but there was some lefover this time (I don't use multiple users). The app didn't show among normal apps, but is was available for uninstall in settings/apps. .apk installed without issue after cleaning it from there. – huancz Mar 08 '23 at 13:11
97

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.

Kamran Bigdely
  • 7,946
  • 18
  • 66
  • 86
Surya Reddy
  • 1,243
  • 8
  • 15
  • 5
    This This this right here is the answer for me. So annoying that this simple thing was not made aware morr blatantly in the program or thru any error messages on the device. thanks man! – LFMekz Apr 22 '20 at 07:18
  • 1
    sorry, but I didn't get the solution, if you build apk, it will be stored in build output -> debug folder, so what's the difference here. – Himanshu Malik Jul 31 '20 at 07:36
  • The solution android:testOnly="false" in Manifest does the Job !!!! Details: Samsung s5e, Android 10, Signed Release APK, v1 signature. – Dimitrios Ververidis Sep 23 '20 at 06:56
  • 1
    Building the apk in Android Studio (Build -> Build APS(s)) worked for me. Thanks! – chocolate cake Feb 15 '21 at 11:16
37

In my case I had the declared my launcher activity as android:exported="false"

<activity android:name=".MainActivity"
            android:exported="false">

I recently targeted android 12 and had to put android:exported attribute in my manifest components, but did not know what to put as the value. changing the value to android:exported="true" worked.

Simran Sharma
  • 852
  • 7
  • 16
32

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

Krishnabhadra
  • 34,169
  • 30
  • 118
  • 167
christophe
  • 659
  • 7
  • 11
24

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)

Akshay More
  • 416
  • 4
  • 9
  • 1
    Thanks! `android:debuggable="true"` leads to `Error: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one [HardcodedDebugMode]`. I tried `android:testOnly="false"`, both `Build > Build Bundl(s) / APK(s) > Build APK(s)` and `Build > Generate SignedBundle APK...` with signature versions v1, v2 (as in the top screenshot). Had to remove previous app before, then install a new one. – CoolMind Oct 15 '18 at 13:40
  • 2
    Recently encountered this problem. Just added android:testOnly="false" and Build -> Build Apks and done. All sorted. Thanks! No need to add any other android property like android:debuggable="true". – androidStud Oct 31 '19 at 22:05
  • `testOnly="false"` did the trick, thanks! – Shailendra Madda Dec 06 '21 at 07:53
21

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.

Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
  • 4
    +1 `android:name` attribute of any `Activity`, `Service`, `BroadcastReceiver` and so on cannot be changed in manifest file. Although it seems to be the private identifier within your app, it is a public API. – caw Dec 13 '12 at 01:22
  • I have to change my launch activity I added a splash screen and inside it I have to download feeds before starting the main activity. Do you have a solution for it other than putting the splash screen inside the main activity? – Chris Sim Jun 25 '14 at 09:05
  • 2
    You can use an tag to handle that! – thiagolr Sep 03 '16 at 08:52
20

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.

124697
  • 22,097
  • 68
  • 188
  • 315
16

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.

Adam Kis
  • 1,404
  • 14
  • 17
  • I had the exact same problem and the exact same solution worked for me. An upvote for that. But, this is also a problem because the apk generated during USB installation is much smaller than the apk created by using Build APK. Is there any way so that the apk generated using Build APK is almost of the same size as that created while installing using USB? – Samudra Ganguly Nov 24 '22 at 02:57
14

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 :)

Thinkcomplete
  • 181
  • 2
  • 7
13

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..

mastDrinkNimbuPani
  • 1,249
  • 11
  • 14
  • Yes, the documentation for this is really misleading. It implies that by setting this to false, other apps cannot run you Activity. It does NOT say that the android OS app launcher cannot run your Activity!!! That should be in flashing red letters with a 72sp font. – SMBiggs Jan 31 '22 at 04:39
12

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.

Rule
  • 629
  • 1
  • 9
  • 19
  • 2
    From Application Manager, select the app (which will show up but be listed as uninstalled) select More and the option to Uninstall for All Users will appear. – Casey Murray Mar 25 '17 at 17:48
12

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!!

Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
Joubert Vasconcelos
  • 550
  • 1
  • 7
  • 22
10

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

Nelson Katale
  • 1,309
  • 15
  • 21
9

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.

Mike F
  • 521
  • 5
  • 11
8

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

7

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.

ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
Nnamdi
  • 71
  • 1
  • 1
6

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

There goes an hour.

Andy
  • 966
  • 11
  • 16
5

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

Using Android Studio, I had previously installed the unsigned debug version of the APK (Build > Build APK) and had to uninstall it before installing the signed release version (Build Variants > Build Variant: release, Build > Generate Signed APK).

mrts
  • 16,697
  • 8
  • 89
  • 72
  • 2
    I've just wasted two hours on the same problem. My app displays the version, eg. "3.5.6", but doesn't show whether it's a debug or release version. I've been fiddling with lots of different files and lost track of where I was, and tried to update a Debug apk with a Release apk. I think Android used to show a message like "conflicting file signatures", but now (Pie, 9.0) you just get "App not installed", with no option to find the reason. A painful lesson! – Stephen Hosking May 21 '20 at 05:11
5

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.

Entropy1024
  • 7,847
  • 9
  • 30
  • 32
  • Huawei P8 Lite, Android 6.0, only has: Advanced / Mem&storage/default location: internal/SDCard It didn't help. – kaay Jan 16 '18 at 10:58
5

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 .

Baum mit Augen
  • 49,044
  • 25
  • 144
  • 182
Avi Mistriel
  • 51
  • 1
  • 1
  • IF you declare your activity twice in the `Manifest.xml` file, a compile error would show unless you have the same activities with same name but in different packages BUT this does not work with me as I checked everything. – blueware Dec 03 '17 at 09:54
4

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" />
SMGhost
  • 3,867
  • 6
  • 38
  • 68
4

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.

Michael Todd
  • 16,679
  • 4
  • 49
  • 69
  • I think during the first time I installed I changed the name. Now the default (app_release.apk) does not install. Maybe I'll try changing it... hmmm. – pashute Aug 19 '18 at 17:26
4

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
M Rajoy
  • 4,028
  • 14
  • 54
  • 111
3

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.

joepadz
  • 91
  • 1
  • 2
    That will work but no the best solution as you will end up with millions of apps installed. See some of the other answers above. – Astra Bear Aug 15 '16 at 00:55
3

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.

Community
  • 1
  • 1
Bob
  • 22,810
  • 38
  • 143
  • 225
3

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.

TalkLittle
  • 8,866
  • 6
  • 54
  • 51
3

for me the cause was that i had multiple builds using different build variants on same phone:

enter image description here

what happened was that some of these builds were built by me, another one was sent to me by another developer.. trying to install the developers while i had other builds (built by me) caused the above error.

so the fix was simple: delete all the builds on my phone (regardless of build variant).. then install the apk sent by my peer.. and it worked like a charm

abbood
  • 23,101
  • 16
  • 132
  • 246
3

In my case, it's because Android Studio 3.0 sets android:testOnly="true" on APKs that build from the release Build Variant.

https://commonsware.com/blog/2017/10/31/android-studio-3p0-flag-test-only.html

So run ./gradlew assembleRelease solve my issue

heavyauto
  • 141
  • 2
  • 9
3

open AndroidMainfest then add verionCode, versionName in application tag and make sure debug able equal false:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="...">

<application
    ...
    android:debuggable="false"
    android:versionCode="1"
    android:versionName="1.0"
    tools:ignore="HardcodedDebugMode">
    ...
</application>

then open build.gradle (module:app) make sure verionCode, versionName exited and minsdk <= your mobile sdk:

defaultConfig {
    ...
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
   ...
}

look into sources: https://developer.android.com/studio/publish/

& https://developer.android.com/studio/publish/preparing

& https://developer.android.com/studio/publish/versioning

and https://developer.android.com/studio/publish/app-signing

Mahmoud Salah Eldin
  • 1,739
  • 16
  • 21
3

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.

Noby
  • 6,562
  • 9
  • 40
  • 63
  • where in the gradle configuration files do i see the target version of android? I don't see it in either `build.gradle` nor in the android manifest file. Unless `compileSdkVersion` (value 23) or `minSdkVersion` (16) or `targetSdkVersion` (22) are pointing somehow to the desired setting. My galaxy is running android 7.0 (and asking to update but I don't allow it to yet). I'm not using android studio to build my react-native app, but rather `gradlew assembleRelease` – pashute Aug 19 '18 at 17:21
3

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.

2

In Marsmallow in owner and guest user is there.If guest installed the same app we can not install the same app in owner.I fixed this delete the app in guest

Ramesh sambu
  • 3,577
  • 2
  • 24
  • 39
  • This is the supidest thing ever - thanks for this - would have searched for hours on this one. – Arqu Oct 27 '16 at 12:17
  • Yes, I discovered this too. My HUAWEI Mate 20 Pro has this multi-user feature too, and I'd installed it on a guest user to demo my dev app to clients. Oops. Solved now. – vr_driver Apr 11 '19 at 14:22
2

Open your logCat when trying to install the app. Set it to "No Filters". Search for "InstallAppProgress" package identifier. If the install fails you should see an "Installation error code". In my case it was

D/InstallAppProgress: Installation error code: -7

From here you can use this link to find information about your specific error code.

sirFunkenstine
  • 8,135
  • 6
  • 40
  • 57
2

This answer is relevant only for apps that use native libraries (Android NDK).

In my case the problem was that some native libraries were missing from jniLibs for the target phone's CPU architecture. Hence the app was working on the emulator, but on a real phone I got "App not installed".

I had originally copied the compiled native libraries only for the x86 architecture, so the app worked on the emulator. However, the other architectures were missing (x86_64, armeabi_v7a, arm64-v8a). After adding the missing *.so files for all architectures into jniLibs, the "App not installed" error went away.

matangover
  • 357
  • 2
  • 12
2

It can also happen if there is not enough space in the internal memory. I had 500Mb free, but it wasn't enough. Try free like 1Gb+.

Apoleo
  • 2,045
  • 2
  • 21
  • 37
2

Sometimes it is because you have no enough space on your phone. If so, try to clean up your memory to create space for new installations.

Elitte
  • 21
  • 5
2

I had a similar situation.I was able to install app in debug mode using USB but not a signed version. I was able to install signed version on other phone, but not on my device. Numerous reasons and solutions did not help me. But one direction I got from a solution "uninstall for all users". What I did is to again install app in debug mode using USB connection, go to app details and "uninstall for all users" from right top 3 dots - to remove debug version. This looks like cleared all kinds of references. I usually do a normal uninstall.

Now I am able to get signed APK on the device and install and its success.

Praveenke
  • 31
  • 1
2

I found that if I built my app with compileSdkVersion, buildToolsVersion, and targetSdkVersion all set to the default value of 30 in my build.gradle file, then the app would not install on my phone. However, if I changed them back down to version 29, it worked. What the issue turned out to be was that from SDK 30 onwards you need to select V2 jar signing. For more info see Why does the Android SDK 30 generate invalid APK files?

Anthony.
  • 643
  • 7
  • 14
1

I had the same type of error this was cauysed by this line in my android manifest XML file.

android:permission="android.permission.INSTALL_LOCATION_PROVIDER"

I removed the line and it solved my issue. Hope this helps

Lunatikzx
  • 264
  • 2
  • 14
1

When this problem happened to me, I fixed it by deleting some non-essential files that I had in my project folder, like the keystore.

In hindsight, it'd probably be bad to give people the keys to your game.

1

In my case my previous released app had signed by another key, so I've uninstalled it, but on my test phone (LG G4 H-818) 2 users exists so previous app still installed on my phone and didn't uninstalled properly! so when I tried to install it again, it failed...

So I've tried to change user and uninstall previous app, finally app installed properly.

Hope it helps you in future :)

Milad Yarmohammadi
  • 1,253
  • 2
  • 22
  • 37
1

I have encountered this issue in various forms, but this time it was a new one:

In this case, I had providers names collision - the same provider name existed in my app and another of my apps.

Gal Rom
  • 6,221
  • 3
  • 41
  • 33
1

If you are trying to install an apk directly from Google Drive, just restarting the device solved the issue for me.

Onur D.
  • 515
  • 3
  • 11
1

I have experienced this "App not installed" error when the device I was installing to didn't have enough storage. Deleting a few files allowed the app to install. Odd that it didn't give me a "not enough space" message instead. (Note: I was installing an apk manually from an "unknown" location.)

Adjwilley
  • 185
  • 7
1

If you are using cordova try to uninstall any previous app that is build through cordova. Strange but this method solved my problem

haidar
  • 1,449
  • 1
  • 11
  • 12
1

You should save this as Debug and not release, check the two JAR signs and also allow installing apps from where you have downloaded this (WhatsApp, chrome, etc...)

Raz Buchnik
  • 7,753
  • 14
  • 53
  • 96
1

I tried all the methods that are generally posted, Was just about to give up, The signing thing solved it.

Found some app that literally said "apk signer", and it did it.

  • Android Studio generates signed apk under its Build menu. This resolved the problem for me. The signed apk is also smaller. – Baruch Youssin Aug 31 '21 at 15:45
0

I'd signed the app with 2 different certs, so removing the older version with the older cert and then reinstalling the new one solved the problem for me

leandroid
  • 11
  • 2
0

I fixed this by not signing the app first and not with Maven. I added this to my build path.

    <plugin>
        <groupId>com.jayway.maven.plugins.android.generation2</groupId>
        <artifactId>android-maven-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
            <sign>
                <debug>false</debug>
            </sign>
        </configuration>
    </plugin>

After that I signed my app by hand: jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore /home/myself/.android/release.keystore myapp-1.0.apk androidreleasekey

Bevor
  • 8,396
  • 15
  • 77
  • 141
0

try to this change in the AndroidManifest.xml:

  • setting debuggable to true
  • signing the apk
cyber cyber1621
  • 167
  • 2
  • 6
0

Make sure that these tips considered:

  1. Your build variants and Flavors should be same(App installed and new one), usually release
  2. Signature file must be the same(*.jks file)
  3. The version you set in build.gradle or AndroidManifest have greater value compared to current version(it is recommended to set version in build.gradle)
  4. URL is correct(doesn't have typo) and server is reachable(WebService/WebMethod/WIFI is running/available and ...)
  5. File downloaded completely
  6. File saved correctly into desired directory
  7. Setting for Data and Type in setDataAndType is correct
Mehran Zamani
  • 831
  • 9
  • 31
0

I also faced the same issue. In my application had services in it. The services was running in the background even after the application was uninstalled, after doing a force stop of the application, got a message saying the application was uninstalled. Then I installed the application with out any problem.

Jayakumar Bellie
  • 9,298
  • 2
  • 17
  • 14
0

If you tried all the answers above and none of them worked, you might want to try this:

If your build variant is 'debug', then you should add this under buildTypes in the app build gradle for the app to install on your device:

debug {
    minifyEnabled false
}
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Ali Nem
  • 5,252
  • 1
  • 42
  • 41
0

I faced this issue with my latest app release to playstore. The issue is combination of change of MainLauncher and app shortcut .

We have added a splash screen and our entry point is SplashActivity instead of MainActivity. So, people who has previous versions and have app shortcut on their home screen can't open the app. It always says something like App not installed toast. This doesn't happen on every launcher (For us it's more common on Samsungs).

Behind the scenes, App shortcut should be seamlessly update entry point from MainActivity to SplashActivity. But, for some reason many third party launchers are not obeying it. The fix is clear the shortcut and add it again.

If you havn't update your app yet in playstore, go through this article.

Beware when updating the launcher activity.

sha
  • 1,410
  • 2
  • 18
  • 37
0
  1. delete .apk file from build>output>apk folder in your app module(project main module).
  2. delete .idea and .gradle folder from root of the project
  3. clean the project.
  4. click on gradle icon from sidebar in android studio and click sync icon to refresh all project. now run the project and it should work.
44kksharma
  • 2,740
  • 27
  • 32
0

If someone is having this issue, check the build number. If your build number is less than the installed app build number, your app will not install and you will get the “Corrupted app or apk file”.

To fix it just increment your build number until it is equal or greater than the installed build number.

ikkarion
  • 178
  • 4
  • 17
  • in my case, when i'm incrementing the build version number. While installing new version the app is updating, at that moment it shows "App not intalled" error. – meekash55 Jul 28 '21 at 11:32
0

In my case i removed Useless permissions that are not required

I Only Needed 1 permission

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

And remove unwanted permissions that are not required and started giving this error

<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INSTALL_LOCATION_PROVIDER" />
<uses-permission android:name="android.permission.CONTROL_LOCATION_UPDATES" />
vijay
  • 10,276
  • 11
  • 64
  • 79
  • 5
    What you wrote is not an answer telling how to solve the issue in the original post. You state that after adding unnecessary permissions it "started giving this error". Maybe what you meant was that removing those three unnecessary permissions solved the problem for you. But that's not what you wrote. Hence the downvotes. – silviot Feb 14 '19 at 11:57
0

Sometimes storage not available is also should be mention because I face this issue because that the device that needs to be installed doesn't have enough space and also the system is not alert to the user. You can just find out because of debugging

Anonymous-E
  • 827
  • 11
  • 29
0

In case, you have your app's older version installed from Google Play and you want to test the newer release version of your app:

  1. Open Google Play Console

  2. Upload the newer release version of your app to Alpha / Beta, but do not release it yet!

enter image description here

  1. You can now download the derived apk:
    enter image description here

Install the downloaded derived apk on your phone now. The derived apk is re-signed by Google Play with a different key from the release app Android Studio generates.

Abduaziz Kayumov
  • 133
  • 2
  • 10
0

This problem is seen for multiple reason.

For me it was happening due to AndroidManifest.xml option of exported being false.

I changed from

    <activity
        android:exported="false"

to

    <activity
        android:exported="true"

After this I was able to launch app from home screen.

dkp
  • 11
  • 3
  • Welcome to Stack Overflow. Though we thank you for your answer, it would be better if it provided additional value on top of the other answers. In this case, your answer does not provide additional value, since [another user already posted that solution](https://stackoverflow.com/a/68607661/3169238). If a previous answer was helpful to you, you should vote it up once you have enough reputation – Sergei Kozelko Mar 23 '23 at 06:45
0

In my case, I was able to resolve the issue by removing the line

compileSdkPreview

from my build.gradle file. It seems that this line sets android:testOnly to true whenever the project is built, which was causing the problem.

Sergei Kozelko
  • 691
  • 4
  • 17
Justin Yu
  • 21
  • 5
0

I ran into this when I had a bug with my custom build tool that would use ADT with a certificate intended for iOS (It certainly wasn't my first guess, since there doesn't seem to be anything special about the Android certificates other than only you should have one, they are just RSA-1024 certs, even self-signed is ok, at least for non-marketplace installs).

Simon Buchan
  • 12,707
  • 2
  • 48
  • 55