ChatGPT解决这个技术问题 Extra ChatGPT

'App not Installed' Error on Android

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.

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.
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?
Have you tried debugging it directly from eclipse in the device connected to the computer to see if the log says anything more?
I did remove the app using the uninstall option from the application manager on the phone.
Felix. Where do I run this adb thing from?

C
Community

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.

https://i.stack.imgur.com/XLH2G.jpg

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!


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.
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)
In my case i have to add this configuration into manifesto file android:installLocation="internalOnly"
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.
Thanks for mentioning "clearing debug app's data". That helped me
Q
Qasim

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


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
Also the case on Android 8 (just to complete the reported gap between 7 and 9).
This works fine. Don't forget to revert the settings once installed apk.
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.
This, plus removing the existing app, solved the problem for me.
t
the-drew

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?


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.
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)
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!"
I changed package name. and it worked. I realized I had tested multiple apps with the same package name so the error.
Yup! I was trying the install a signed release apk when I had a debug build of the app installed on my phone 🤦
A
Astra Bear

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.


has same issue. I had a guest account activated and when removing the app, it did not remove from all users.
I really appreciate if you can provide some screenshots
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.
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.
What is an Android version? 6.0?
K
Kamran Bigdely

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.


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!
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.
The solution android:testOnly="false" in Manifest does the Job !!!! Details: Samsung s5e, Android 10, Signed Release APK, v1 signature.
Building the apk in Android Studio (Build -> Build APS(s)) worked for me. Thanks!
K
Krishnabhadra

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


Thanks for the hint! In my case android:exported was set to false for launcher activity
S
Simran Sharma

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.


A
Akshay More

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)


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.
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".
testOnly="false" did the trick, thanks!
S
Sergey Glotov

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.


+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.
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?
You can use an tag to handle that!
1
124697

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.


A
Adam Kis

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.


T
Thinkcomplete

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


Not sure what you mean by 'Test Only' but setting debuggable to true and signing the apk worked for me!
didn't worked for me. I used: android:testOnly="false" android:debuggable="false"
could you explain? I have neither attributes at all, not set true and not false, just not there. How does the line look?
m
mastDrinkNimbuPani

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


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.
S
Sergey Glotov

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


This fixed it for me... more info stackoverflow.com/questions/6282169/…
That is incredibly strange. Was this for an emulator or device?
R
Rule

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.


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.
N
Nelson Katale

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.

https://i.stack.imgur.com/AQyIE.png

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


This helped me for a device that runs Android 6
M
Mike F

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.


I just tried setting android:allowBackup="true" to android:allowBackup="false" and still no luck.
it says " Manifest merger fails with multiple error "
J
Jose Luis De la Cruz

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


Я
ЯegDwight

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.


A
Andy

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

There goes an hour.


E
Entropy1024

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.


Huawei P8 Lite, Android 6.0, only has: Advanced / Mem&storage/default location: internal/SDCard It didn't help.
C
Chinthaka Senanayaka

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)


m
mrts

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


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!
B
Baum mit Augen

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 .


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

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

M
Michael Todd

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.


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.
G
Gabriel Sanmartin

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

N
Noby

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.


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
t
threeshinyapples

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.


j
joepadz

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.


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.