33

I have checked all the solutions, comments and answers of all other questions in StackOverflow.

I have been running, compiling and debugging my app for months. But suddenly it started to appear this message in my Eclipse when using my Nexus to play with it.

MOBILE:

  • I have no root !!! (It's a Nexus, and I have no root, and all the answers in other Stackoverflow's questions need root to be executed)
  • The application is uninstalled, there's no trace of it in "Applications"
  • Since I don't have root access, I can not access to /data/data folder, or /data/local, or /data
  • I do know problem would be solved resetting the phone to factory settings, but, sincerely, I can not.

ECLIPSE:

  • I have cleaned the project many times, restart Eclipse and even update it
  • I can not change the name of the project (as one solution suggests), since it's a long time project and I can not change it
  • Console says:

    • Installation error: INSTALL_FAILED_UID_CHANGED
    • Please check logcat output for more details.
    • Launch canceled!
  • Logcat says:

    • 01-05 12:18:19.265: W/ActivityManager(761): No content provider found for permission revoke: file:///data/local/tmp/MyApp.apk
    • 01-05 12:18:20.855: W/PackageManager(761): Package couldn't be installed in /data/app/com.myapp-1.apk
  • I can install, uninstall other APK/applications with no problems at all. So it's not about permissions in /data folder/subfolders

CONSOLE:

  • If I try to uninstall (with -d or any other parameter) the app it says: "Failure" (because adb does not find the app in the phone)

So, I'm not debugging with virtual machine / emulator. I have a Nexus no-rooted with no trace of the application, and I can not build the app from Eclipse to the device.

Thank you

FlamingMoe
  • 2,709
  • 5
  • 39
  • 64
  • I have the exact same issue right now. I now have 2 devices that I can't deploy to. This has happened to me once before; I was only able to resolve the issue after a factory reset. I do not want to do that this time of course. – mdupls Jan 08 '14 at 19:54
  • 1
    I can't believe a factory reset is the solution to a properly bug like this one. – FlamingMoe Jan 09 '14 at 16:53
  • Agreed. I'm still looking into a solution. Until then, I had to get my device back up and running. – mdupls Jan 10 '14 at 15:09
  • Have you modified the android:sharedUserId field in your app Manifest? If so, I assume you've already read this article: http://stackoverflow.com/questions/12338242/eclipse-installation-error-install-failed-uid-changed – anddev84 Jan 10 '14 at 22:30
  • Yes anddev84 ... I tried also that. – FlamingMoe Jan 11 '14 at 19:36
  • tried all the solution below, not working for me, consider of reset to factory – Gohan Jun 30 '15 at 04:14

20 Answers20

10

I had the same issue in my non-rooted Nexus 5. I managed to solve it without root access nor Factory reset.

For this device, I managed to solve it by going to Settings -> Storage -> Misc and try to delete any files related to the faulty app (in my case, an .apk that was pushed from Android Studio and a .db file). I also clicked on Cached data to wipe the cache for all apps.

I don't know exactly which of the two things triggered the solution. You probably want to try to delete some files in Misc before wiping the cached data, since it seems less of an overkill.

It seems to be that there were some remaining files from a previous installation which weren't wiped with the uninstall (probably an issue in the Android installation system). These files aren't accessible without root access, since they are under the /data/local/ folder. Apparently the Storage tools for the Nexus 5 have permission to delete files under that folder.

I don't know whether other devices have a similar set of storage tools.

Christian García
  • 3,939
  • 1
  • 26
  • 26
5

Downloading app from play store will resolve the issue. To continue development on the app, uninstall the currently installed app and just launch the app from eclipse.

It works fine.

Sunil Kumar
  • 61
  • 1
  • 6
  • This is the only solution that worked for me. I think Android studio failed midway uninstalling the old app and installing then uninstalling from the play store seems to have cleared any left over data properly. – speedynomads Jul 13 '15 at 14:50
3

This may seem odd, but my pointy-haired boss just had this issue and tried everything we could think of. Just would NOT install due to the INSTALL_FAILED_UID_CHANGED error.

He uninstalled some other apps (games) and suddenly it would install. Maybe it is an issue of disk space on internal card? Dunno, but worth a try when someone else hits it.

DustinB
  • 11,037
  • 5
  • 46
  • 54
3

First time this happened I tried installing from eclipse, from command line etc.... Everything failed so I did a factory reset which then worked.

24 hours later it happened again.

Not wanting to do another factory reset, I tried all the same things again to no avail.

Lastly I tried downloading our current app from the appstore, which miraculously worked.

I then used adb to reinstall.

So if you have a version of your app in the app store, try installing that to get something on your phone, then do a reinstall "adb -d install -r $PACKAGE.apk

Hope this helps someone.

guyland123
  • 841
  • 9
  • 4
2

This (or some other magic) helped me:

adb shell pm clear MY_PACKAGE_NAME
Viachaslau Tysianchuk
  • 1,680
  • 19
  • 22
1

I can solve this like below without rooting on my Nexus 5.

  • Push your app to /sdcard/
  • adb push test.apk /sdcard/
  • adb shell
  • adb shell pm install -l /sdcard/test.apk

-l option means - pm install: installs a package to the system. Options: -l: install the package with FORWARD_LOCK.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
TJ Kim
  • 19
  • 3
1

Here are some other things to check/try that are safe to do:

  • Make sure your package name is 100% unique and not colliding with another app. You could temporarily change it to test.
  • Try powering your phone off and then back on to clear data caches.
  • Try a soft reset for your device (which might be the same as powering off/on).
scottt
  • 8,301
  • 1
  • 31
  • 41
1

Try deleting Cached Data under Settings -> Storage, this will clear all cached App data at once, but it does the job (in my case)

Moïze
  • 707
  • 8
  • 16
0

This is because of if you have install the app with same package name. So try to remove that one.

Usman Afzal
  • 558
  • 1
  • 6
  • 13
0

I could only fix this by rooting. I know you don't want to do that, but it worked for me. I downloaded Titanium Backup then found my uninstalled app crossed out in the list on Titanium Backup. I couldn't get rid of that crossed out one until I went to Batch Actions then Remove orphan data. That allowed me to re-install my app and it worked well.

Adam VanWert
  • 440
  • 5
  • 10
0

This worked for me:

adb install -l -r <'apk_name'>.apk

-l = forward lock

-r = reinstall

Karim Varela
  • 7,562
  • 10
  • 53
  • 78
  • didn't work. i think there are corrupt files under data dir. i can't access without root. here is the error: Failure [INSTALL_FAILED_UID_CHANGED] – droideckar Feb 06 '15 at 23:30
  • 1
    not work. same as others `Failure [INSTALL_FAILED_UID_CHANGED]` – Ninja Dec 22 '15 at 05:33
0

I had this exact same problem. What finally worked for me was to change the applicationId (your package name) in build.gradle to something different, then rebuild the project, and voilà, successful deployment.

What led to this situation was that I'd copied an existing Android Studio project into a new one, and was working off of that new one. The thing is, I'd never deployed the original apk on my device before, and was only trying to deploy the new copy of the app.

Tim S. Van Haren
  • 8,861
  • 2
  • 30
  • 34
0

I was using a device that was just for testing, so I just reset the whole device. It worked for me anywho.

Kent Robin
  • 2,066
  • 20
  • 19
0

This solution worked for me:

  1. Put your APK to the device's storage/sd card

  2. adb shell pm install -l -r "/sdcard/<apk_filename>.apk"

-l = forward lock -r = reinstall

gentra
  • 6,066
  • 3
  • 16
  • 18
0

For no root Device you need you need to delete the app from the app list in the device:

  1. go to "settings"
  2. go to "storage"
  3. on third tab "downloaded apps" locate your app
  4. you can delete it from there

Works for me!

Eli
  • 586
  • 2
  • 12
  • 28
0

In my case changing the package name of the GCM signature worked. since it uninstalls the complete package.

For more detailed explination click here

<permission
        android:name="com.androidcodelab.sampleproject.permission.C2D_MESSAGE"
        android:protectionLevel="signature"/>
   <uses-permission android:name="com.androidcodelab.sampleproject.permission.C2D_MESSAGE"/>

Package name of the project changed to :

<permission
        android:name="com.androidcodelab.xyz.permission.C2D_MESSAGE"
        android:protectionLevel="signature"/>

    <uses-permission android:name="com.androidcodelab.xyz.permission.C2D_MESSAGE"/>

and then I reverted back to the actual package name

user3496326
  • 129
  • 1
  • 5
  • 13
0

For android studio go to File-> Project Structure -> app -> Flavors and your right side you will see Application Id field just change Application Id and you are ready to go... :)

0
  1. Go to Run/debug configurations.
  2. Under Android App delete "app".
  3. Then add another configuration under module: app

enter image description here

Angela Sanchez
  • 450
  • 1
  • 4
  • 12
-1

For me the only way was to root the phone and clear /data/data/ directory. Here are the steps:

1. Open web browser on mobile device
2. Open website: https://towelroot.com/
3. Click on lambda sign to download Towerl Root and install it afterwards
4. Open Towel root app and click on button "make it rain". If it says: "device not compatible" google other wait to root the device.
5. Download SuperSU app from Play Store
6. Download Terminal Emulator app from Play Store
7. Run Terminal Emulator
8. Type following command in terminal emulator:

su

9. Allow superuser access for terminal emulator
10.Type following command in terminal emulator, substitute 'package_name' with your app's package name:

rm -r /data/data/package_name

palimad
  • 67
  • 3
-1

I tried all above and NADA!

the ONLY way it works for me (NON ROOTED DEVICE) was:

1.- Change on Project structure [Ctrl+Alt+Shift+S]->Flavors: the Application Id, for example: 'com.example.something' to 'com.example.somethingxx'. (which is the same as changing on the build.gradle file)

2.- Refactor package name of the project to the SAME NEW NAME you used on Application Id: 'com.example.somethingxx'

This will ensure you are installing a new App on the device... let me know!

Mike
  • 1
  • I can't change neither ApplicationId nor package name, because I already have an app published in GooglePlay with customers using a paid version. – Marcelo Feb 02 '15 at 02:14