Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Clearing cache on Android device is ineffective. #167

Open
noozoo opened this issue Feb 6, 2017 · 15 comments
Open

Clearing cache on Android device is ineffective. #167

noozoo opened this issue Feb 6, 2017 · 15 comments
Assignees

Comments

@noozoo
Copy link

noozoo commented Feb 6, 2017

@macdonst As mentioned privately.
Nexus 6 with Android 7.0.
If I first clean the cache and data of my app, then uninstall the app, and then reinstall it, I see the old javascript running when I inspect in Chrome://inspect.

Any workaround you know of would be helpful.

@noozoo
Copy link
Author

noozoo commented Feb 6, 2017

Update. After clearing the cache and data, uninstalling, and then restarting my phone, the new code is in there.

@aramando
Copy link

aramando commented Feb 7, 2017

It's almost certainly caused by Auto Backup for Apps. When reinstalling an app, its data is restored from a backup associated with your Google account. I started seeing this issue when I upgraded from a Nexus 5 running Android 6.0.1 to a OnePlus 3 on the same OS version, and still do with Android 7.0.

The solution is simply to clear the app data after you install the new version of the APK. You don't need to uninstall the existing version beforehand or restart the phone at any point.

You can prevent the behaviour by disabling Automatic restore in the system Backup & reset settings, or by putting the phone into flight mode so that it can't access the backup - but then you still have to either clear the app data or uninstall the existing APK to achieve the same result before installing and running the updated APK, so it achieves little and has obvious drawbacks.

@noozoo
Copy link
Author

noozoo commented Feb 7, 2017

When you clear the cache or uninstall there ought to be an option to remove the backups, too. Something Google is working on, hopefully.

@macdonst
Copy link
Member

macdonst commented Feb 7, 2017

@noozoo @aramando What do you guys think about changing the sync directory to the one returned by getNoBackupFilesDir? This lines up with iOS as it stores the sync data in a location that is not backed up to iCloud.

@macdonst macdonst self-assigned this Feb 7, 2017
@aramando
Copy link

aramando commented Feb 7, 2017

@macdonst I can't think of a reason not to.

@noozoo
Copy link
Author

noozoo commented Feb 7, 2017

That will prevent that backup from happening for the app?

@aramando
Copy link

aramando commented Feb 7, 2017

Presumably it would only prevent the backup of files copied from the app binary or downloaded from the remote content source (e.g. the AEM server), which I don't imagine would ever be required to be backed up (since they can just be re-copied/downloaded).

I suppose it could be made into a plugin config option, defaulting to storing files in no-backup location, but with the option to change that.

@macdonst
Copy link
Member

macdonst commented Feb 7, 2017

@noozoo can you try the issue167 branch?

@macdonst
Copy link
Member

@noozoo did you get a chance to test the issue167 branch?

@noozoo
Copy link
Author

noozoo commented Apr 12, 2017

No it did not, sorry. A lot has happened, and as you know, we've been moved to other things.

@macdonst
Copy link
Member

@noozoo is the ticket getting passed on to someone else to resolve?

@noozoo
Copy link
Author

noozoo commented Apr 12, 2017

@macdonst I don't think we have a Jira ticket for this.

If you like I could create one and assign it to Rofe, but I don't know when it'll get looked at...

@macdonst
Copy link
Member

@noozoo please do

@noozoo
Copy link
Author

noozoo commented Apr 12, 2017

@noka03
Copy link

noka03 commented Apr 18, 2017

It looks like changing this location puts the sync'd files in a location that is very slow to read from when using the cordova-file-plugin rather than the read write location provided by cordova.file.dataDirectory which is reasonably fast.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants