You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Serious issue of inconsistent content by deploying apk #591
I recently started to build a debug apk for easy of deploying various devices for testing (which also similar production deployment) but I encountered very strange behavior. Apk got deployed but content sometimes show updated and sometimes not. Also same apk deploy to 2 devices but one shows correctly but another devices shown incorrectly. This could be easy to tell looking at UI already. The problem happen randomly so very painful. I wish more people try this way and see if more people got the same problem.
Steps: #1. build apk by "tns build android". #2. copy the xxx_debug.apk from platforms\android\build\outputs\apk to my share place. #3. I installed the apk to 2 devices. note: both devices had early version installed.
From app info, both devices got the same, in term of content, they look different see the attachment for 2 devices.
Device1: content not updated look like old UI. hw.zip
Device2: content did updated show correctly note2.zip
On device 1, Also try clean cache, clean data on the device, uninstall package from device package manager, then install apk from my share place. Still had same problem - correct app version but incorrect content.
Any idea? How can I further troubleshoot? How could I know what content I am running on?
I am a bit worry what happen if this is on production environment, Would user will face this problem? If so, user wouldn't know about it. So this is very critical issue.
Which platform(s) does your issue occur on?
Only tried on Android not IOS
Please provide the following version numbers that your issue occurs with:
>tns info
All NativeScript components versions information
┌──────────────────┬─────────────────┬────────────────┬───────────────┐
│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 2.3.0 │ 2.3.0 │ Up to date │
│ tns-core-modules │ 2.3.0 │ 2.3.0 │ Up to date │
│ tns-android │ 2.3.0 │ 2.3.0 │ Up to date │
│ tns-ios │ │ 2.3.0 │ Not installed │
└──────────────────┴─────────────────┴────────────────┴───────────────┘
Hi @ryc16,
I couldn't reproduce your problem when I repeated the steps you provided. I tried building the default application and installing it by hand on different emulator api levels: 17, 19, 21, 24. The resulting UI is the same. If you want us to help you, can you provide a small repo causing the problem and be more specific with the api versions you tried running the application on?
@Plamen5kov, this doesn't happen all the time. I just wonder how does the android deployment works. Where does the content running at? For example, running at /data/data//files or it actually running on different location? When apk got deployed, does the process delete all files (including cache files if exist)? Would it possible some files is being locked on the file system?
@ryc16 when adb -r install <apk_name>-debug.apk is called, the application is copied on the device
for api level 17 in /data/app/<app_name>.apk and
for api level 24 in /data/app/<app_name>-1/base.apk
and then unpacked inside the folder you mentioned
/data/data/<full_app_name>/
When the app is uninstalled all these directories are deleted, so I can think of no way for the same app to have different behavior. I can suggest using the -r option on the adb command that will remove the previous application with the same name before installing the new one, or uninstalling manually before installation.
@Plamen5kov, I could try when it happen again (I didn't uninstall from device app manager which I think the same so not sure if adb -r helps). Is adb -r is the regular deployment process or handle by tns android cli? If your suggestion is just for troubleshooting, then it is ok otherwise this wouldn't be production solution. So there is no cache mechanism of running content, right? What about the javascript layer? Hope other people could replicate this problem.
I updated an XML file to fix a spelling issue, tested it on a real Nexus 7 device worked fine. Uploaded the debug apk to a server and downloaded it to a real Motorola G and the old UI was still there!
Now more people are able to catch this strange problem. This kind of problem is very scary if it is on production. We don't know if user really running/showing the latest content.
Hi @ryc16,
I agree with you, but you have to understand, if we can't reproduce your problem, we can't fix it. I would be grateful if you find a scenario, where this bug can be reproduced, so we can take it on.
Hi @Plamen5kov, understood. it is not consistent to me so not sure how to let you reproduce the problem. @therevills, is it consistent to you? would you have anything for @Plamen5kov .
@NathanaelA thanks for describing the process in details.
It just came to my attention that we face the problem internally too. I can finally confirm that this is indeed an issue with temp directory not being erased on certain devices, despite permissions being granted.
I would also like to add that the bug does not affect packages built in release, so publishing and updating applications should be safe.
Since I couldn't quite figure it out, this was a temporary workaround for me.
Based off of the comments, I was able to delete the files in /data/local/tmp/ using adb and now my apk that I installed is actually using the files from the apk.
to get the directory name, you can find it by running this
@cjdreiss 3.0.0 will be officially released next week. Using the 3.0 CLI and installing the 3.0 android runtime in your projects (even if you still use 2.5 modules) should prevent your files from going stale.
Activity
NickIliev commentedon Oct 19, 2016
From @ryc16 on October 18, 2016 11:5
In order to get the content up to date, I have to plug my device to my computer and use tns command.
tns livesync android --watchAfterwards, everything works as expect.
Again, I am worry what would be happend if app is in production and install from ie google play store. Would this happen?
Plamen5kov commentedon Oct 25, 2016
Hi @ryc16,
I couldn't reproduce your problem when I repeated the steps you provided. I tried building the default application and installing it by hand on different emulator api levels: 17, 19, 21, 24. The resulting UI is the same. If you want us to help you, can you provide a small repo causing the problem and be more specific with the api versions you tried running the application on?
ryc16 commentedon Oct 25, 2016
@Plamen5kov, this doesn't happen all the time. I just wonder how does the android deployment works. Where does the content running at? For example, running at /data/data//files or it actually running on different location? When apk got deployed, does the process delete all files (including cache files if exist)? Would it possible some files is being locked on the file system?
Plamen5kov commentedon Oct 26, 2016
@ryc16 when
adb -r install <apk_name>-debug.apkis called, the application is copied on the device/data/app/<app_name>.apkand/data/app/<app_name>-1/base.apkand then unpacked inside the folder you mentioned
When the app is uninstalled all these directories are deleted, so I can think of no way for the same app to have different behavior. I can suggest using the
-roption on theadbcommand that will remove the previous application with the same name before installing the new one, or uninstalling manually before installation.Adb command is:
ryc16 commentedon Oct 26, 2016
@Plamen5kov, I could try when it happen again (I didn't uninstall from device app manager which I think the same so not sure if adb -r helps). Is adb -r is the regular deployment process or handle by tns android cli? If your suggestion is just for troubleshooting, then it is ok otherwise this wouldn't be production solution. So there is no cache mechanism of running content, right? What about the javascript layer? Hope other people could replicate this problem.
Plamen5kov commentedon Oct 26, 2016
@ryc16, yes the CLI uses
-ras the default command when installing the application as you can see here.I can't tell you if android has a cache mechanism, I haven't looked into it.
I can't reproduce the issues at hand, so it's a suggestion to help you isolate the problem. If we manage to do that, we can figure it out.
therevills commentedon Nov 4, 2016
I've seen this issue too... very strange!
I updated an XML file to fix a spelling issue, tested it on a real Nexus 7 device worked fine. Uploaded the debug apk to a server and downloaded it to a real Motorola G and the old UI was still there!
ryc16 commentedon Nov 6, 2016
Now more people are able to catch this strange problem. This kind of problem is very scary if it is on production. We don't know if user really running/showing the latest content.
Plamen5kov commentedon Nov 7, 2016
Hi @ryc16,
I agree with you, but you have to understand, if we can't reproduce your problem, we can't fix it. I would be grateful if you find a scenario, where this bug can be reproduced, so we can take it on.
ryc16 commentedon Nov 7, 2016
Hi @Plamen5kov, understood. it is not consistent to me so not sure how to let you reproduce the problem.
@therevills, is it consistent to you? would you have anything for @Plamen5kov .
Plamen5kov commentedon Nov 28, 2016
@ryc16 did you mange to isolate the issue, or find a way for us to reproduce it?
Plamen5kov commentedon Dec 2, 2016
I'm closing this issue, because there's no response, but feel free to reopen it again, if you find a way to reproduce it.
7 remaining items
NathanaelA commentedon Apr 8, 2017
petekanev commentedon Apr 9, 2017
@NathanaelA thanks for describing the process in details.
It just came to my attention that we face the problem internally too. I can finally confirm that this is indeed an issue with temp directory not being erased on certain devices, despite permissions being granted.
I would also like to add that the bug does not affect packages built in release, so publishing and updating applications should be safe.
petekanev commentedon Apr 25, 2017
Addressed with changes in PR #743 as well as some modifications inside the CLI version 3.0.0
cjdreiss commentedon Apr 26, 2017
@Pip3r4o how do we go about getting this update?
Since I couldn't quite figure it out, this was a temporary workaround for me.
Based off of the comments, I was able to delete the files in /data/local/tmp/ using adb and now my apk that I installed is actually using the files from the apk.
to get the directory name, you can find it by running this
Then, I did
petekanev commentedon Apr 26, 2017
@cjdreiss 3.0.0 will be officially released next week. Using the
3.0CLI and installing the3.0android runtime in your projects (even if you still use 2.5 modules) should prevent your files from going stale.NickIliev commentedon Jul 17, 2017
+1 Reported via t.1119637 with
tns-android 3.2.0petekanev commentedon Jul 17, 2017
@NickIliev the changes released earlier this year unfortunately do not fix the problem occurring on Samsung devices.
daveware-nv commentedon Dec 11, 2017
I can confirm this still happens with 3.3.1
to reproduce:
tns run androidtns build androidand thenadb install path/to/appName-debug.apkto the same device/emulator that the livesync was hooked up totns deploy androidto the same device/emulator that the livesync was hooked up toThis problem doesn't seem to affect release builds (
tns build android --release) or clean deploy (tns deploy android --clean)waqasyousafy commentedon Dec 11, 2020
what is the solution plz