Skip to content

tns now seems to be caching things where it shouldn't #943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sitefinitysteve opened this issue Sep 18, 2015 · 10 comments
Closed

tns now seems to be caching things where it shouldn't #943

sitefinitysteve opened this issue Sep 18, 2015 · 10 comments
Labels
Milestone

Comments

@sitefinitysteve
Copy link

I've been struggling all night with my 1.3 app (was fine on 1.2)

Seems that when I change things like adding\removing a style.xml file in App_Resources the only way to get NS to update is to platform remove\add android back in.

Worse was upgrading from 1.2 to 1.3 the entire app, all my custom scripts and views were all cached and loading old versions. I could change style colors in styles.xml, they get reflected, but any of my views or scripts all ran\debugged as if I changed nothing. However if I formed invalid xml, well then that would crash the thing, but any other changes wouldn't show up. tns debug even showed me I was CLEARLY on the old scripts as well.

CONFUSED

@sitefinitysteve
Copy link
Author

Example
image

Added the debugger line because there's clearly a bug in there
tns debug android starts up the debugger, but as you can see the debug script does not have any of my changes.

@rosen-vladimirov
Copy link
Contributor

Hi @sitefinitysteve,
May I ask you for the versions of the ios and android runtimes that you are using? In version 1.2.x of CLI and runtimes there are several issues with application's reloading after livesync. If you have used the livesync functionality and you have not updated the tns-ios and tns-android versions, you'll see the last livesynced application.
Can you try using latest android and ios versions and see if it works for you?

@sitefinitysteve
Copy link
Author

I'm on {N} 1.3, I have done tns remove\add android multiple times to try to fix it.

So I encountered this this morning as well, and this is what I noticed

  1. Livesync always has the latest code (ctrl-c to cancel)
  2. Added a debugger line in code
  3. tns debug android
  4. App fired back up, no debugger line in the code
  5. Started livesync BACK up, wait for app to load, kill livesync
  6. tns debug android, debugger line is now there and breaking fine

Now I also noticed that my segmentedbar selectedIndexChanged event is also not firing (one of the reasons I needed to debug)

tns doctor reports
C:\Dropbox\Projects\Leap\OutbreakHelp\Mobile\Native\OutbreakHelp>tns doctor
WARNING: You can work with iOS only on Mac OS X systems.
To be able to work with iOS devices and projects, you need Mac OS X Mavericks or later.

Version strings are not in the same format

doctor

┌─────────┬──────────────┐
│ Usage │ Synopsis │
│ General │ $ tns doctor │
└─────────┴──────────────┘

@rosen-vladimirov
Copy link
Contributor

Hi @sitefinitysteve
It looks like you are using older version of Gradle (The message Version strings are not in same format is caused by this when running tns doctor). Could you try installing gradle 2.3 or later?

@sitefinitysteve
Copy link
Author

Okay, FYI gradle installs via chocolaty to 2.2.1 per the docs, 2.2.3 (or latest) hasn't been released yet...maybe update the docs to just install manually?

Updating now

@sitefinitysteve
Copy link
Author

No issues with 2.2.7 all last night figers crossed

I will close as to not clog up the works

@stephenfeather
Copy link
Contributor

Adding a note for those driving by, if installing gradle with homebrew, be sure to update your brew to get the latest formulas, then upgrade your gradle to 2.7.

Feel free to reclose

@sitefinitysteve
Copy link
Author

Okay, it's happening right now

I added this to my script (wanted to inspect the searchBar object)
var searchBar = page.getViewById("searchResources");
debugger;
searchBar.dismissSoftInput();

tns debug android

...no "debugger" in the result

tns run android
tns debug android

...still no "debugger" in the result

@Fatme Fatme added the bug label Sep 30, 2015
@Fatme
Copy link
Contributor

Fatme commented Sep 30, 2015

Hi @sitefinitysteve,

We've found the problem on our side and we're working on the fix.

As a workaround I can suggest you to do the following:

  1. Open the source code of {N} CLI - execute which tns
  2. Open lib/common/mobile/android/android-device.js file and add this line _this.adb.executeShellCommand(["rm", "-rf", "/data/local/tmp/"+packageName+"/fullsync"]).wait(); at the beginning of deploy function.

The another option is to execute adb shell rm -rf /data/local/tmp/<applicationIdentifier>/fullsync && tns run android.

Hope this will help you.

@sitefinitysteve
Copy link
Author

I am so happy! Thanks @Fatme ...will close, hope this makes 1.4

@Fatme Fatme added this to the 1.4.0 milestone Sep 30, 2015
Fatme pushed a commit that referenced this issue Sep 30, 2015
Due to some policy restrictions on devices with apilevel 21+, android runtime is not able to delete sync directories. This way if some files are changed after livesync, changes are not applied on the device.

Fixes #943
Fatme pushed a commit that referenced this issue Sep 30, 2015
Due to some policy restrictions on devices with apilevel 21+, android runtime is not able to delete sync directories. This way if some files are changed after livesync, changes are not applied on the device.

Fixes #943
Fatme pushed a commit that referenced this issue Oct 1, 2015
Due to some policy restrictions on devices with apilevel 21+, android runtime is not able to delete sync directories. This way if some files are changed after livesync, changes are not applied on the device.

Fixes #943
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants