I have been doing debugging on Android using my Nexus 4, however I recently encountered this error here. After doing some research on this error, it seems to be an issue wit
It is obviously because of improper uninstall (probably due to faulty cable connection).
SOLUTION Download SDMaid from play-store, and delete Corpse files (junk files). Re-run application. (But you need to have your device rooted)
For me, there was a bit more to it. Simply removing /data/data/appfolder
didn't help.
The additional reason was that my external libs weren't included in .apk
file because the name of folder was lib instead of libs. This has caused [INSTALL_FAILED_DEXOPT]
during apk
installation followed by [INSTALL_FAILED_UID_CHANGED]
.
So changing libs folder name worked for me in this case.
Restart your device, and clear your project. Basically , uninstalling would have done this for you in case if doesn't then try restarting.
In most cases INSTALL_FAILED_DEXOPT
or INSTALL_FAILED_UID_CHANGED
means that you have not enought space to install the app.
Remove some unused apps from your device or at least remove current version of your app.
adb uninstall package-name
In very rare cases there may be problem with application data. You have two options depending on whether your device is rooted or not
Non-rooted
Factory reset Settings -> Backup and reset -> Factory data reset
(at least for Samsung S5)
Rooted (or emulator)
adb shell "rm -rf /data/data/package-name"
I was experiencing this issue for the past couple days on my Galaxy Note 3 test device. I have been using Calabash-Andrdoid and kept getting an error INSTALL_FAILED_UID_CHANGED, whenever the install_app method tried to execute. I was struggling with this issue because I had two test devices experiencing this. I tried everything above, including emptying out my /data/data/ app and app.test folders. I even deleted the instrumentation back-end stuff that Xamarin installs since that's the platform I used to develop my app. I could not find anything else to manually delete off of the device. When I attempted to do my work on third device and found that everything ran successfully, I realized the issue was with the devices. In the end, the only thing that worked for me was to execute a factory reset of one of the devices. I hope this helps.
Thanks, -Shah
Same problem on a Mediacom device, first a
$ adb install -r platforms/android/out/android-debug-unaligned.apk
3958 KB/s (22887489 bytes in 5.647s)
pkg: /data/local/tmp/android-debug-unaligned.apk
Failure [INSTALL_FAILED_DEXOPT]
then a very persistent:
$ adb install -r platforms/android/out/android-debug-unaligned.apk
4949 KB/s (22887489 bytes in 4.515s)
pkg: /data/local/tmp/android-debug-unaligned.apk
Failure [INSTALL_FAILED_UID_CHANGED]
Doing a factory reset didn't change the dynamic (I got both errors, in sequence).
Rooting not an option, the solution for me was a cache wipe: now the offending app id works fine and I didn't had to factory reset (again).
Hope it helps