Skip to content
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

Splash Screen asset generation fails for iOS #5063

Closed
lini opened this issue Oct 9, 2019 · 1 comment
Closed

Splash Screen asset generation fails for iOS #5063

lini opened this issue Oct 9, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@lini
Copy link
Contributor

lini commented Oct 9, 2019

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: 6.1.2
  • Cross-platform modules:
  • Android Runtime: 6.1.2
  • iOS Runtime: 6.1.1

Describe the bug

When an image asset is missing from https://github.com/NativeScript/nativescript-cli/blob/master/resources/assets/image-definitions.json , the asset generation will fail with an exception, because it will try to scale the image with invalid values for width/height.

To Reproduce

Create a new project that has iOS LaunchImage.launchimage assets, that include Default-2688h.png Try to generate splash screen assets for the project using a 1024x1024 png image.
Generation will fail with :

Invalid settings specified for the resizer., Error: Invalid settings specified for the resizer.
    at Resize.initialize (C:\Work\GitHub\kinvey-sidekick\dist\sources\node_modules\nativescript\node_modules\jimp\resize.js:25:16)
    at new Resize (C:\Work\GitHub\kinvey-sidekick\dist\sources\node_modules\nativescript\node_modules\jimp\resize.js:17:10)
    at Jimp.resize (C:\Work\GitHub\kinvey-sidekick\dist\sources\node_modules\nativescript\node_modules\jimp\index.js:1762:22)
    at Jimp.scale (C:\Work\GitHub\kinvey-sidekick\dist\sources\node_modules\nativescript\node_modules\jimp\index.js:1891:10)
    at Jimp.scaleToFit (C:\Work\GitHub\kinvey-sidekick\dist\sources\node_modules\nativescript\node_modules\jimp\index.js:1916:10)
    at AssetsGenerationService.<anonymous> (C:\Work\GitHub\kinvey-sidekick\dist\sources\node_modules\nativescript\lib\services\assets-generation\assets-generation-service.js:101:26)

Expected behavior
Assets are generated correctly.

Sample project

Additional context
Kinvey Studio Desktop project updated to 6.1.2 exhibits this behavior when generating assets using Sidekick.

@KristianDD
Copy link
Contributor

Hi, @lini ,

It turned out that some of the assets' names do not match with our image definitions and the images inside NativeScript templates. The fix will just show a warning, if no image definition is matched and will continue the resources generation for the matched ones.

Can be tested with the attached application.

skipAssetTest.zip

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

4 participants