528

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.

18
  • 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. Nov 19, 2010 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, 2010 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, 2010 at 16:29
  • 2
    I did remove the app using the uninstall option from the application manager on the phone. Nov 19, 2010 at 16:43
  • Felix. Where do I run this adb thing from? Nov 19, 2010 at 16:44

67 Answers 67

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.

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.

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

1
  • had the same problem, i guess the solution is to always sign builds when using flavors
    – Nickmccomb
    Jun 28, 2016 at 2:11
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

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

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

2
  • This is the supidest thing ever - thanks for this - would have searched for hours on this one.
    – Arqu
    Oct 27, 2016 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, 2019 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.

4
  • Though the answer is a couple years old, I've tried checking it. My app seems to fail with the Installation status code: 1 May 24, 2021 at 20:08
  • @KasperSeweryn have your found the issue and resolved it?
    – sureshbabu
    Jul 6, 2021 at 19:22
  • @sureshbabu I started building signed release builds and the issue was no more. Jul 7, 2021 at 9:12
  • @KasperSeweryn pls explain. so it will be useful to others. Did u change anything?
    – sureshbabu
    Jul 7, 2021 at 10:31
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.

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

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.

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.

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?

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

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.

2
  • This was it exactly. And yea, probably not the best idea. Thanks! +1
    – Maxx
    Jun 18, 2014 at 4:10
  • 1
    Why do you think the keystore file will be copied to apk?
    – CoolMind
    Oct 15, 2018 at 14:05
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 :)

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.

1

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

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

1

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

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

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.

1
  • Android Studio generates signed apk under its Build menu. This resolved the problem for me. The signed apk is also smaller. Aug 31, 2021 at 15:45
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).

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

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

0

try to this change in the AndroidManifest.xml:

  • setting debuggable to true
  • signing the apk
1
  • But i want to create release APK and i have to build with ionic cordova build android --prod --release command. Jun 29, 2018 at 9:33
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
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.

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.

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.