Skip to content

Image replacement is not respected during tns run android #2981

Closed
NativeScript/NativeScript
#4672

Description

@vchimev

If an existing image in the app folder (outside App_Resources) is replaced during tns run android, the application on the device does not get updated with the new image. However, if the application is restarted, the new image is shown. The same scenario works for iOS.

Version of CLI, runtimes and tns-core-modules packages: 3.1.0.

Steps:

  • tns create appJS && appJS
  • mkdir app/img/ - make a img directory in the app folder
  • add an image to the app/img folder
  • refer the image in the main-page.xml, for example: <Image src="~/img/icon.png" />
  • tne run android
  • replace the image

Expected: the application page refreshes and the new image shows.
Actual: the application page refreshes, but the new image does not show. The old one is still on the page.

Activity

  1. self-assigned this
    on Jul 21, 2017
  2. Plamen5kov commented on Jul 24, 2017

    @Plamen5kov
    Contributor

    On the cli and runtime side everything looks ok. Runtime has livesynced the new image into the application, and calls the livesync hook as it should. That leads me to believe the nativescript modules can't recognize that the icon.png has changed. ping: @PanayotCankov @vakrilov

  3. added this to the 3.2.0 milestone on Aug 1, 2017
  4. hshristov commented on Aug 1, 2017

    @hshristov

    @vchimev, @Plamen5kov We are using memory and disk cache on the Image component. That is why changing the file won't change the currently shown image.

    There are several options:

    • Invalidate the whole cache on a livesync operation
    • Disable cache for specific Image instance
  5. Plamen5kov commented on Aug 1, 2017

    @Plamen5kov
    Contributor

    My vote goes toward Disable cache for specific Image instance.

  6. vchimev commented on Aug 1, 2017

    @vchimev
    Author

    Disable cache for specific Image instance sounds better to me.
    @hshristov, what do you think would be the best?

  7. removed their assignment
    on Aug 3, 2017
  8. Plamen5kov commented on Aug 3, 2017

    @Plamen5kov
    Contributor

    I'm opening a new issue in the modules because this is no longer a CLI problem.

  9. self-assigned this
    on Aug 3, 2017
  10. removed this from the 3.2.0 milestone on Aug 3, 2017
  11. self-assigned this
    on Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions