_From @vbresults on December 28, 2017 7:26_
Yes
I cannot sync my Android app. It seems to be loading the js not from the apk but from somewhere else it was cached weeks ago, and I can't clear this cache.
I've tried deleting the app cache in the android settings page, deleting the gradle cache, reinstalling the android platform, and NOTHING has worked. Where is this cache..?
It seems to be bound to com.example.mypackagename, the only solution right now is to use a different package name which is problematic.
The only thing I imagine could have triggered this is using the debug command recently, I have not been able to sync the source code to the Android app since.
Android
_Copied from original issue: NativeScript/NativeScript#5214_
@vbresults uninstall the application from the device/emulator you are testing on and also remove platforms folder before rebuilding and redeploying the application with tns run android.
I would suggest migrating to the latest NativeScript 3.4.x (if using WebPack migration guide here)
_From @vbresults on December 28, 2017 11:8_
Found them... the caches are here:
/data/local/tmp/com.example.mypackagename/fullsync/main.js
/data/user/<uid>/com.example.mypackagename/
This appears to be some sort of bug with livesync that 1. leaves that directory behind after a reinstall and 2. causes it to be unaffected by tns build/run --clean.
@vbresults we recognize that this is a problem with certain devices (Samsungs, mostly), and is even more pronounced on devices of API 23+ where file permissions have become more strict.
The mechanism used is such that the changed files are sent to the device cache (the tmp dir), and at startup, the Android Runtime reads and copies the cached files in place of its own current files, then proceeds to delete the tmp directory. However that operation can fail on more restrictive Android distributions, such as those of Samsung S series.
As a workaround, if you see the problem occurring again while developing, deleting the data/local/tmp/<package.name> should be sufficient to get you back up and running. Releasing apps should not be a concern, as release apps disable the livesync android runtime mechanism.
As a fix - we could use a socket server on the device whose only purpose will be to serve the changed files to the application, and that would hopefully remove all errors which you are now experiencing.
Could also be related to this: NativeScript: Android application upgrade issues http://fluentreports.com/blog/?p=516#comment-32155
@Closing as this [particular issue is no longer reproducible on my side.
Most helpful comment
@vbresults we recognize that this is a problem with certain devices (Samsungs, mostly), and is even more pronounced on devices of API 23+ where file permissions have become more strict.
The mechanism used is such that the changed files are sent to the device cache (the tmp dir), and at startup, the Android Runtime reads and copies the cached files in place of its own current files, then proceeds to delete the
tmpdirectory. However that operation can fail on more restrictive Android distributions, such as those of Samsung S series.As a workaround, if you see the problem occurring again while developing, deleting the
data/local/tmp/<package.name>should be sufficient to get you back up and running. Releasing apps should not be a concern, as release apps disable the livesync android runtime mechanism.As a fix - we could use a socket server on the device whose only purpose will be to serve the changed files to the application, and that would hopefully remove all errors which you are now experiencing.