question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New icons added to res in App_Resources causes full build every save

See original GitHub issue

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.0.2
  • Cross-platform modules: 5.0.5
  • Android Runtime: 5.0.0
  • iOS Runtime: n.a
  • Plugin(s):

Describe the bug I recently added two new app icons which I had generated from AndroidAssetStudio. After copying the generated files from:

drawable-hdpi/
drawable-mdpi/
drawable-xhdpi/
drawable-xxhdpi/
drawable-xxxhdpi/

Into App_Resources/Android/src/main/res/ respectively, everytime I save a file it runs a full Gradle build of the project whereas before it only ran a “livesync” build. Not sure of the build type, but all I know is it used to be a few seconds between saving files (i.e., a typo) and now it takes at least a minute which severely drags dev time.

To Reproduce

  1. Go to AndroidAssetStudio and generate an icon set;
  2. Download icon set and unzip;
  3. Place the generated files into the matching res/ folder within App_Resources;
  4. Run the application normally as tns run android
  5. Save any file within the app;
  6. Note how it now says Building project...

Expected behavior Instead of a full re-build of the application it should display the following:

Executing before-shouldPrepare hook from /Users/developer/git/obsidian/osm-client-native/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Skipping prepare.
Successfully transferred app-routing.module.js on device 712KPDT1214194.
Refreshing application on device 712KPDT1214194...

Sample project

Additional context

I’ve tried determining a solution from these previous discussions:

I’d like to add that if this is expected behavior it should be noted in the docs Action-Bar because as it stands it looks like you should be able to:

You can use local image (e.g., ~/images/add.png) or resource (e.g., res://ic_add). Because there is no way to explicitly set width and height for icons, the recommended approach is using resources.

I can confirm I can add an image via ~/images/add.png but the image appears small and as stated I cannot customize that height, so instead I wanted to add my own resource res:// which worked, but at the cost of a full build every time I saved a file which should not be the case.

Thanks in advance! ~Px

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
endarovacommented, Jan 21, 2019

Hey @Manbearpixel ,

Thanks for providing the detailed logs. When a change is applied, CLI checks the state of the project to determine what it should do - just sync the current change or rebuild the application. Based on your logs, we have noticed (as you’ve already said) that CLI decides that the App_Resources/Android/src/main/res/drawable-hdpi/receive_white.png file is modified. This can happen due to two reasons (in case we know you have not modified it on your own):

  1. Some of the hooks modify the file
  2. The modified date of the file is in the future and during check for changes CLI compares it with the date modified of a file inside platforms. To check this, please execute the following: node -e 'console.log(require("fs").statSync("<path to receive_white.png>"))' && date And send us the output
0reactions
Fatmecommented, Apr 15, 2019

Closing due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App resources overview - Android Developers
This document shows you how to group your resources in your Android project and provide alternative resources for specific device configurations ...
Read more >
Visual Studio 2019 disable auto-building solution on save
Another one but very similar cause of the automatic rebuild and restart is Auto build and refresh browser after saving changes option under ......
Read more >
Working with .resx Files Programmatically - .NET
Create or retrieve data from XML resource (.resx) files programmatically using types and members in the System.Resources namespace of the .
Read more >
Developer Program Policy - Play Console Help
People from all over the world use Google Play to access apps and games every day. Before submitting an app, ask yourself if...
Read more >
App Resources - webOS TV Developer - LG
Here are the design guidelines for app icons. It is recommended that small and large app icons be identical, except the size, to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found