2

Problem I am developing an Android app and for some reason I have the "App not installed" error when trying to install the package on my Android device. This application has already previously been installed successfully.

To investigate, I went for the basics:

  1. Uninstall my app from the device
  2. Make sure Security>Unknown Source is checked
  3. Created an HelloWorld app with random package name and tried to install on device: SUCCESS
  4. Created an HelloWorld app with same package name as my problematic project: FAILED

So my guess is that my package name is pointing to some stuff that was not uninstalled correctly.

Question Is there a way to make sure that all the data on an Android device related to a package name is deleted?

Context - Developing directly in android with the AIDE app. No access to any computer at the time since I am travelling. Device: - Samsung Galaxy Notes 10 2014 - Android 4.3 (not rooted)

Absolom
  • 1,369
  • 1
  • 13
  • 28
  • I assume it runs fine on the emulator? – Sree Mar 27 '14 at 04:04
  • I think, Application on android OS should not have same package name for example: org.arya.lntts.MainActivity as a laucher for Application one and same package name should not be given to different application. please try incresing your android:versionCode –  Mar 27 '14 at 04:05
  • @Sreekanthss: I am developing directly on Android with the AIDE IDE app, so no emulator. I am travelling, so no access to computer. – Absolom Mar 27 '14 at 04:07
  • https://play.google.com/store/apps/details?id=com.gijoon.pkgnameviewer try this app and see is there any existing app as @PawanAryan said – Sree Mar 27 '14 at 04:10
  • @PawanAryan: But if I uninstall the application first, I should be able to install any other application with same package name. No? Shouldn't the Android OS remove any reference to the package name when uninstalling an app? – Absolom Mar 27 '14 at 04:10
  • You can do three thing : 1. Use command prompt to uninstall the application. (Not possible as you already said you dont have machine access right now) 2. Sign you android app with key that was used to sign your previous application. 3. Else login as the owner and go to the settings->apps... Scroll down to the end of the list where ur old version was listed with a mark 'not installed'. Select it and press the 'settings' button in the top right corner and finally 'uninstall for user / all users' –  Mar 27 '14 at 04:15
  • @Sreekanthss: Thx, but it is not listed. My guess is that this app list all the applications installed and then extract their package name. My application is not installed but the package name seems to point to something. Is there some kind of registry like in Windows where this could be found? – Absolom Mar 27 '14 at 04:15
  • Also, once try to Delete App data by clicking on "Clear Data" then uninstalling the app. Afterward try to install ur new version. you question is unique one it has to be voted up –  Mar 27 '14 at 04:23
  • @PawanAryan: The application does not appear anywhere in the system. The previous version (the one that was working) was installed correctly in debug mode. I uninstalled it to install the new version in debug mode as well (version number not changed) and then this error began to appear. So there is no app to uninstall because the app cannot install. There must be some data left after the uninstall, but not sure where. – Absolom Mar 27 '14 at 04:34
  • last option i can advice, install old version again now then try to Delete App data by clicking on "Clear Data" then uninstalling the app. Afterward try to install ur new version. –  Mar 27 '14 at 04:37
  • @PawanAryan: Unfortunately, it doesn't work anymore. Since the problem occurred, any app with the com.absolom.ricochetrobot package name cannot be installed. – Absolom Mar 27 '14 at 04:41
  • Do you have access to the LogCat? Is there any information after the installation failed? – FD_ Mar 27 '14 at 09:06
  • Sometime it happens when the application is not signed. – Franklin Hirata Mar 27 '14 at 16:17
  • If you have the app instaled on your device, uninstall it before. – Franklin Hirata Mar 27 '14 at 16:18
  • Based on what I have seen in the comments, I would guess that the problem is not to do with a previous installation. You might want to take a look at your manifest and make sure there aren't any obvious errors there – jcw Mar 27 '14 at 16:47
  • @jcw Like I mentioned in my question, I created basic HelloWorld apps to prove that it has nothing to do with my code. As soon as I use the problematic package name, the app won't installed. No problem if I use another one... – Absolom Mar 28 '14 at 09:18
  • I you have create a multiple profiles in your device, Try checking whether the app is uninstalled form them all, before installing it again. – kAnNaN Mar 28 '14 at 14:15

1 Answers1

1

One reason why this could happen is because during the last uninstall, not all relevant application files have been removed. I don't know why this happens, but i know that it does sometimes happen.

There might be files left over that are owned by a user/group id that is no longer assigned to an application. When you now install an app with the same packagename, it will get a new user/group because it is not an update, but a fresh install. As your app still has the same package name it wants to create the same files, but it can't because one or more files/dirs still exists from the previous install and it can't overwrite/delete them as it lacks the permission because the are owned by different user/group ids.

You could check the following location for files/dirs relating to your packagename, but i doubt you will able to do much without root access.

  • /data/data
  • /data/app
  • /data/app-asec
  • /data/app-lib
  • /data/dalvik-cache
  • /data/local/tmp
  • /mnt/asec
  • /mnt/obb
  • /mnt/sdcard/Android/obb

(Full disclosure: This is my app)

With root, the "CorpseFinder" feature of SD Maid will check the most common locations (see settings) for this issue.

darken
  • 807
  • 12
  • 25