Giter Club home page Giter Club logo

Comments (23)

rodrigograca31 avatar rodrigograca31 commented on May 22, 2024 18

After changing the icon to a 1024px image it works with no problems.....

At this point I would close the issue because was my mistake but there's still the wrong error message problem....

from capacitor-assets.

developer-zone-area avatar developer-zone-area commented on May 22, 2024 12

Use proper dimension for image,
icon.png = 1024x1024 px
splash.png = 2732x2732
then run " ionic cordova resources " command it can solve your issue in not let me know

from capacitor-assets.

imhoffd avatar imhoffd commented on May 22, 2024 3

Hey all, I just pushed 0.5.1 which should show very specific errors for invalid sources images. Here's an example you may see:

WARN: Error with source file resources/icon.png: The dimensions for source image of type "icon" do not meet minimum size requirements: 1024x1024 (image is 329x343).

Let me know what you think!

from capacitor-assets.

imhoffd avatar imhoffd commented on May 22, 2024 2

The cause of this error can be seen with the --verbose flag, but obviously we need to be a lot better at bubbling up the reason for this issue: small dimensions or invalid files.

from capacitor-assets.

wallstudios avatar wallstudios commented on May 22, 2024 2

Great thanks. One less thing to have to debug :)

from capacitor-assets.

RafaelKr avatar RafaelKr commented on May 22, 2024 1

Awesome, thank you!

from capacitor-assets.

lunchboxsushi avatar lunchboxsushi commented on May 22, 2024 1

Is there anyway to keep 512x512 for Android or is this a requirement going forward? I've got a couple hundred apps that are managed. The current assets are all setup in our CD to 512 and would be a huge undertaking to increase to 1024x1024. The original solutions that was build used the Heroku ionic resource tool which recently got decommissioned and accepted 512x512. Any suggestions are appreciated

from capacitor-assets.

rodrigograca31 avatar rodrigograca31 commented on May 22, 2024

further testing:
version 0.2.0 gives similar error and version 0.1.0 works (but now I want version 0.3.0 😂)

from capacitor-assets.

rodrigograca31 avatar rodrigograca31 commented on May 22, 2024

I found the issue....
It was my mistake but also a bad error message for the actual problem....

I was using a 512px icon.
I found out this was the problem because the error is thrown by ResolveSourceImageError which only runs if readSourceImage goes bad and calls RASTER_RESOURCE_VALIDATORS which calls rasterResourceValidator but even thought this last one has the proper error messages they dont get outputted.......

from capacitor-assets.

imhoffd avatar imhoffd commented on May 22, 2024

Was there any output before the error message?

from capacitor-assets.

rodrigograca31 avatar rodrigograca31 commented on May 22, 2024

As far as I remember: no
It was only that line.

from capacitor-assets.

RafaelKr avatar RafaelKr commented on May 22, 2024

I got the same error with a splash.png file with too small dimensions.
This is the output I got:

$ ionic cordova resources android --splash --force
> cordova-res android --type splash
[cordova-res] ERROR: Missing source image for "splash" (sources: resources/android/splash.png, resources/android/splash.jpg, resources/android/splash.jpeg, resources/splash.png, resources/splash.jpg, resources/splash.jpeg)
[ERROR] An error occurred while running subprocess cordova-res.
        
        cordova-res android --type splash exited with exit code 1.
        
        Re-running this command with the --verbose flag may provide more information.

I think the error in this case is very misleading.

from capacitor-assets.

wallstudios avatar wallstudios commented on May 22, 2024

Used to be able to generate using .PSD files. Now need png or jpg. that was my issue.

from capacitor-assets.

mebibou avatar mebibou commented on May 22, 2024

hum it now says:

$ ionic cordova resources
> cordova-res
[cordova-res] WARN: Error with source file resources/icon.png: Error
[cordova-res]     at new BaseError (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/error.js:7:23)
[cordova-res]     at new ValidationError (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/error.js:31:9)
[cordova-res]     at rasterResourceValidator (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/resources.js:34:15)
[cordova-res]     at async readSourceImage (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/image.js:32:22)
[cordova-res]     at async Object.resolveSourceImage (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/image.js:18:20)
[cordova-res]     at async generateSimpleResources (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/platform.js:77:20)
[cordova-res]     at async safelyGenerateSimpleResources (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/platform.js:53:16)
[cordova-res]     at async generateAdaptiveIconResources (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/platform.js:116:68)
[cordova-res]     at async safelyGenerateAdaptiveIconResources (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/platform.js:98:16)
[cordova-res]     at async Object.run (/.nvm/versions/node/v12.5.0/lib/node_modules/cordova-res/dist/platform.js:19:28) {
[cordova-res]   details: [Object],
[cordova-res]   name: 'ValidationError',
[cordova-res]   code: 'BAD_SOURCE'
[cordova-res] }

using [email protected]

from capacitor-assets.

mebibou avatar mebibou commented on May 22, 2024

@AnandRaj786 the point being the error is once again not descriptive enough. @dwieeb my guess is the message is actually in the details: [Object] part?

from capacitor-assets.

imhoffd avatar imhoffd commented on May 22, 2024

@mebibou That output is unfamiliar to me for 0.6.0. I tested on my repo and got the proper warnings, but I may have missed something. Can you run cordova-res --verbose?

from capacitor-assets.

pookdeveloper avatar pookdeveloper commented on May 22, 2024

Use --verbose to get the exact error

from capacitor-assets.

cristiancorreau avatar cristiancorreau commented on May 22, 2024

The PSD template is bad. Modify size resolution in Photoshop (1024x1024 px)

from capacitor-assets.

imhoffd avatar imhoffd commented on May 22, 2024

@cristiancorreau Which PSD template?

from capacitor-assets.

cristiancorreau avatar cristiancorreau commented on May 22, 2024

@cristiancorreau Which PSD template?

https://ionicframework.com/docs/cli/commands/cordova-resources

@dwieeb try with this files https://github.com/cristiancorreau/ionic-resources-templates

from capacitor-assets.

git102347501 avatar git102347501 commented on May 22, 2024

我也遇到了类似问题,修改分辨率1024后得到解决。

from capacitor-assets.

imhoffd avatar imhoffd commented on May 22, 2024

@lunchboxsushi Good point. I just created #93 to track that. PRs welcome! 💙

from capacitor-assets.

cybanjar avatar cybanjar commented on May 22, 2024

Solved! https://github.com/ionic-team/capacitor-assets/issues/18#issuecomment-513126979
Follow dimension for image,
icon.png = 1024x1024 px
splash.png = 2732x2732

from capacitor-assets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.