ProgressNS / sidekick-feedback

This repository is for feedback regarding NativeScript Sidekick. Use the issues system here to submit feature requests or vote for existing ones.
45 stars 9 forks source link

Error when trying to generate iOS icons #199

Closed Burgov closed 6 years ago

Burgov commented 6 years ago

Please, provide the details below:

Did you verify whether this issue has already been reported here?

Yes

Tell us about the problem

When I try to generate iOS icons, i get the error

[18-05-24 11:32:45.945] Invalid settings specified for the resizer., Error: Invalid settings specified for the resizer.
    at Resize.initialize (C:\Users\Bart\AppData\Roaming\npm\node_modules\nativescript\node_modules\jimp\resize.js:25:16)
    at new Resize (C:\Users\Bart\AppData\Roaming\npm\node_modules\nativescript\node_modules\jimp\resize.js:17:10)
    at Jimp.resize (C:\Users\Bart\AppData\Roaming\npm\node_modules\nativescript\node_modules\jimp\index.js:1762:22)
    at Jimp.scale (C:\Users\Bart\AppData\Roaming\npm\node_modules\nativescript\node_modules\jimp\index.js:1891:10)
    at Jimp.scaleToFit (C:\Users\Bart\AppData\Roaming\npm\node_modules\nativescript\node_modules\jimp\index.js:1916:10)
    at AssetsGenerationService.<anonymous> (C:\Users\Bart\AppData\Roaming\npm\node_modules\nativescript\lib\services\assets-generation\assets-generation-service.js:97:26)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\Bart\AppData\Roaming\npm\node_modules\nativescript\lib\services\assets-generation\assets-generation-service.js:10:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Generating Android icons works fine and generating iOS splash screens works fine as well. Tried multiple computers running Windows or MacOS

Which platform(s) does the issue occur on?

See above

Provide the following version numbers that the issue occurs with:

Tell us how to recreate the issue in as much detail as possible

  1. Start the application
  2. Open a project
  3. Go to assets
  4. Browse for any png file (or drag it in) and select at least iOS
  5. Error message thrown in console

Does this issue happen every time?

Yes

Send the client logs

See above

ivanovit commented 6 years ago

Hi,

This error comes from the image library that we use for image generation. Could you send us a .png that we could use to reproduce the issue?

Thank you in advance.

Burgov commented 6 years ago

Hi, find an icon attached (although I tried multiple, and they all seem to give the same output. And like I said, splashscreen works fine)

icon-marketing-1024x1024

ivanovit commented 6 years ago

Hi,

Yes, as you mentioned the problem is not related to the image (I have missed the part that it is working for iOS splash screens and Android icons). We were not able to reproduce the issue neither for iOS icons on our projects.

The icons are generated(resized) by following the conventions in the Contents.json file. As we were not able to reproduce the issue I suspect that there is some case that is not handled from the Contents.json specification. Is there any chance that you have made any custom modifications of the <appPath>\app\App_Resources\iOS\Assets.xcassets\AppIcon.appiconset\Contents.json file?

I would like to ask you to send us the <appPath>\app\App_Resources\iOS\Assets.xcassets\AppIcon.appiconset\Contents.json file to inspect it?

Burgov commented 6 years ago

Hi @ivanovit , I don't believe there's any customization in there, but I could be mistaken. Here's the contents:

{
    "images": [
        {
            "idiom": "iphone",
            "size": "20x20",
            "scale": "2x",
            "filename": "Icon-20x20@2x.png"
        },
        {
            "idiom": "iphone",
            "size": "20x20",
            "scale": "3x",
            "filename": "Icon-20x20@3x.png"
        },
        {
            "idiom": "iphone",
            "size": "29x29",
            "scale": "1x",
            "filename": "Icon-29x29@1x.png"
        },
        {
            "idiom": "iphone",
            "size": "29x29",
            "scale": "2x",
            "filename": "Icon-29x29@2x.png"
        },
        {
            "idiom": "iphone",
            "size": "40x40",
            "scale": "2x",
            "filename": "Icon-40x40@2x.png"
        },
        {
            "idiom": "iphone",
            "size": "40x40",
            "scale": "3x",
            "filename": "Icon-40x40@3x.png"
        },
        {
            "idiom": "iphone",
            "size": "60x60",
            "scale": "2x",
            "filename": "Icon-60x60@2x.png"
        },
        {
            "idiom": "iphone",
            "size": "60x60",
            "scale": "3x",
            "filename": "Icon-60x60@3x.png"
        },
        {
            "idiom": "iphone",
            "size": "1024x1024",
            "scale": "1x",
            "filename": "Icon-marketing-1024x1024.png"
        }
    ],
    "info": {
        "version": 1,
        "author": "apetools.webprofusion.com"
    }
}
ivanovit commented 6 years ago

Thank you for the fast response. We were able to reproduce the exact same error. I will get back to you once we have more information.

ivanovit commented 6 years ago

We found a bug on our side and will be fixed.

As temporary workaround you can manually add width and height to definitions by getting them from the size property. After generation you can revert the changes to this file if you want(because it's auto-generated).

{
    "images": [
        {
            "idiom": "iphone",
            "size": "20x20",
            "scale": "2x",
            "filename": "Icon-20x20@2x.png",
            "width": 20,
            "height": 20
        },
        {
            "idiom": "iphone",
            "size": "20x20",
            "scale": "3x",
            "filename": "Icon-20x20@3x.png",
            "width": 20,
            "height": 20
        },
        {
            "idiom": "iphone",
            "size": "29x29",
            "scale": "1x",
            "filename": "Icon-29x29@1x.png",
            "width": 29,
            "height": 29
        },
        {
            "idiom": "iphone",
            "size": "29x29",
            "scale": "2x",
            "filename": "Icon-29x29@2x.png",
            "width": 29,
            "height": 29
        },
        {
            "idiom": "iphone",
            "size": "40x40",
            "scale": "2x",
            "filename": "Icon-40x40@2x.png",
            "width": 40,
            "height": 40
        },
        {
            "idiom": "iphone",
            "size": "40x40",
            "scale": "3x",
            "filename": "Icon-40x40@3x.png",
            "width": 40,
            "height": 40
        },
        {
            "idiom": "iphone",
            "size": "60x60",
            "scale": "2x",
            "filename": "Icon-60x60@2x.png",
            "width": 60,
            "height": 60
        },
        {
            "idiom": "iphone",
            "size": "60x60",
            "scale": "3x",
            "filename": "Icon-60x60@3x.png",
            "width": 60,
            "height": 60
        },
        {
            "idiom": "iphone",
            "size": "1024x1024",
            "scale": "1x",
            "filename": "Icon-marketing-1024x1024.png",
            "width": 1024,
            "height": 1024
        }
    ],
    "info": {
        "version": 1,
        "author": "apetools.webprofusion.com"
    }
}

We apologize for any inconvenience caused. Please let us know if this solution works for you.

Burgov commented 6 years ago

That's awesome, thanks! Your workaround did the trick.