Comments (23)
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.
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.
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.
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.
Great thanks. One less thing to have to debug :)
from capacitor-assets.
Awesome, thank you!
from capacitor-assets.
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.
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.
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.
Was there any output before the error message?
from capacitor-assets.
As far as I remember: no
It was only that line.
from capacitor-assets.
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.
Used to be able to generate using .PSD files. Now need png or jpg. that was my issue.
from capacitor-assets.
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.
@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.
@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.
Use --verbose to get the exact error
from capacitor-assets.
The PSD template is bad. Modify size resolution in Photoshop (1024x1024 px)
from capacitor-assets.
@cristiancorreau Which PSD template?
from capacitor-assets.
@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.
我也遇到了类似问题,修改分辨率1024后得到解决。
from capacitor-assets.
@lunchboxsushi Good point. I just created #93 to track that. PRs welcome! 💙
from capacitor-assets.
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)
- Upgrade `@capacitor/cli` to fix `xml2js` `CVE-2023-0842` vulnerability HOT 1
- npm install error --iOS ( IONIC/ANGULAR Project )
- Source directory option name HOT 2
- Android splash screen looks distorted on Samsung S9 HOT 3
- 3.0.0: Cannot upload iOS app due to failed asset validation HOT 4
- "Unable to parse color from string" HOT 3
- Android Oreo (API 2) doesn't show proper Splash Screen HOT 1
- Feature request: Specify output folder for PWA HOT 1
- Chrome reports warnings with generated PWA icons
- sharp vulnerability in libwebp dependency HOT 2
- PNPM installation failed, cause by sharp v0.32.5 post install script HOT 1
- Suggestion: generate banner images HOT 2
- cannot install @capacitor/assets HOT 1
- Notifications support?
- bug: iOS icons/splash are created twice and overwritten by a bigger one
- Security advice semver HOT 1
- Can´t generate assets by using angular HOT 1
- Can we programatically run @capacitor/assets to generate and copy all the app/splash icons to ios/android folders
- can't install capacitor assets HOT 2
- [email protected] deprecated!! HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capacitor-assets.