I'm writing my first app for android and I already faced a irritating bug on Samsung devices with android 2.2.1.
http://code.google.com/p/android/issues/detail?id=14359
The problem is that the shared preferences becomes inaccesible when you reinstall the app, because the directory with preferences is not deleted and new reinstalled version is not owner of the directory. What results in situation when there are lot of settins saved in shared_pref and user updates the app he lose all the settings and cannot save new one.
As these devices with this version of android are still big part of the market and I'm already aware of this bug I would like to find some workaround for this issue.
On rooted devices I can perform chown to solve the problem.
Does anybody has an idea how to solve it on non-rooted devices (without migrating all setings to sql database)?
I was thinking about manually deleting the directory when I'm still its owner, but the problem is when to do it?
Is there any intent on app uninstall or update?
Is there any intent on app uninstall or update?
Update, yes, but this problem should not exist on an update. A regular update does not uninstall and reinstall the app, so the bug should not be triggered.
You do not get control at uninstall time.
Related
I have no idea what causing the error in my android project. The error "Failed to start several time. Restore it by clearing its history." happen in some of the mobile manufacturer like Oppo, Samsung etc... And I found it only happen once the app uninstall then re-install back through PlayStore. It also happen to those after updated the app.
It will only open up once I clear its data. Anyone have idea about this?
It should be work as others app even though I uninstall and reinstall back for testing purpose, this happen to part of our client as well.
In AndroidManifest Change
android:allowBackup="false"
Hope it will solve the problem
I'm using Android Studio 3.5 and can't install an app from it.
My app is already on play store and I'm upgrading the app.
It keeps saying there's a same application.
Okay, so I deleted it, but it keeps saying that.
First a pop-up window saying that I will have to uninstall the existing application. I know why it happens. I develop on my laptop and my desktop at the same time so it happens all the time. And this app doesn't have my data so I've clicked okay and proceeded and there was no problem. But,
The device already has an application with the same package but a different signature.
Retry
The application could not be installed: INSTALL_FAILED_UPDATE_INCOMPATIBLE
in new. And even I don't have the app, why does it say like that???
And installation is way too quick on play store.
I think the app isn't deleted properly.
So basically, I have no app on the phone, the data, cache, apk, anything, but it keeps saying there is a same app with a different signature.
I have
Deleted the existing app and it still didn't work
Re-downloaded the app and ran and didn't work
And as expected, it says if I wanna delete it, pushed OK. And the app is
automatically deleted.
also adb uninstall com.~~.~~ not working
Set debuggable true, still not working
Ran on a friend's phone which already has the exact same app from the store
and it works.
Tried to disable instant run but android studio 3.5 does not have that anymore.
Rebooted my phone.
Deleted caches of android studio and restarted it, as many as I could.
adb shell pm list packages -f : the package does not exist.
done adb uninstall com.~~.~~ and got Success code, but still not working
There's nothing wrong with codes.
Build works perfect. It runs perfectly on my friend's phone.
I expect for the app to run perfectly but,
the studio says
The device already has an application with the same package but a different signature.
Retry
The application could not be installed: INSTALL_FAILED_UPDATE_INCOMPATIBLE
Also, installation is too slow. It wasn't slow like this.
this happen when you have multiple spaces or user in single phone, it will be helpful if you can tell about your phone model
I followed steps from this tutorial:
Exported .apk can install on all my devices, but when I uninstalled and then installed my phone said 'App not installed'. My clients had the same problem even from the first installation.
There are no multiple users on my phone or any other so I can't do 'uninstall for all users'.
After that I tried to export from Android Studio with same keystore and passwords and it just created more problems with the same initial problem and that's 'App not installed'.
After that I resolved many problems that Android Studio made with updates and I still can't export it properly from Visual Studio Code.
My head hurts.
Edit: Now I've tried jarsigner and zipalign and it still doesn't want to install.
EDIT2: Issue goes away when I move .apk to internal storage. Is this a legit solution?
This is a very open ended question and it's quite hard to give a clear answer without further information. But usually 'App not installed' error happens because of following reasons (among others)
Insufficient storage
Corrupted/Contaminated App file
SD Card not mounted in the device
Storage location
Corrupt storage
Application Permission
Incorrect file
things you can try
Do the tried and tested "Have you turned it off and on again"?
Delete unnecessary files/Apps
Reset All the App Preference
Go to Settings on your Android device.
Open Apps or Apps manager.
check for All Apps.
Tap on the menu icon.
Click on ‘Reset App Preferences’.
Clear Data and Cache of Package Installer
Open setting on your Android device.
Look for the option called Apps or Manage apps and tap on it.
Check for the Package Installer App under system Apps
You will find two option of Clear data and Clear cache. (For Android Marshmallow 6.0 users check for option Storage to clear data and cache)
Clear the data and cache to solve the problem.
You could also try changing the bundle id and see if that would do the trick
Hope this helped
I was wondering if it is possible to uninstall the default Settings application on an Android emulator. I have already tried "adb uninstall com.android.settings" but it comes up with Failure.
Thanks
com.android.settings is not a user installable application. It lives in the system folders and as such is not user removable. If you rooted your device you could remove it but I suspect many applications rely on it and removing it will cause problems. That said root your emulator and try: How to get root access on Android emulator?
You can always create a new emulator image if you mess up the rooted one.
I haven't tried, but you can remove default applications with apps such as Titanium Backup if you're a rooted user.
** EDIT **
Overlooked the emulator part of the question - apologies.
I would advise against uninstalling it, as I'm not sure you can get it back - it's one of those things that you def need on your phone.
At least do a backup (Nandroid or otherwise) before removing it, so you can get it back easily if you make a mistake/need it again.
I made an app that use the sharedPreferences and i storage some info there, when i uninstall the app and install again the info storage there always appear, i don´t know why. I don´t programming anything to keep them there.
I just upgrade my Galaxy S to 2.2.1 and i did a back up of all my apps including that i made, i don´t know sure if Android does not erase correctly the app.
I did uninstall others apps like facebook one and apparently erase all files fine.
I need suggestion of what can i do, please.
I have the same problem too, and the problem is in the Galaxy S 2.2.1 ROM. It is buggy.
It saves the shared preferences in /dbdata/databases/app-package
Unfortunatelly when you uninstall the application that place is not cleared! It's frustrating.
It makes SharedPreferences completely useless in Galaxy S. When you uninstall, re-install the app you can never change SharedPreferences again.
I don't know if this is still an open question anymore but so long as you follow the rules in the Internal Data Storage API then the files should be deleted for you automatically when the project exits.
You can save files directly on the device's internal storage... When the user uninstalls your application, these files are removed.