alexdisler / cordova-splash Goto Github PK
View Code? Open in Web Editor NEWAutomatic splash screen generator for Cordova
License: MIT License
Automatic splash screen generator for Cordova
License: MIT License
If you don't use the storyboard launch format, then the iPad Pro build will be scaled up. More info here: http://cordova.apache.org/docs/en/7.x/reference/cordova-plugin-splashscreen/index.html#launch-storyboard-images
Hi,
Both cordova-icon and cordova-splash are working fine but the android application still shows the default cordova icon/splash.
It seems that cordova-splash outputs in "platforms/android/app/src/main/res/" while the project still uses "platforms/android/res/".
Tried to remove/add the android platform without much success. And linking to the good dir yielded a complain about missing config.xml file
My versions:
Node version: v9.2.1
Cordova version: 7.1.0
All the images are created properly, but I don't see any adjustments made to config.xml. It detects it, and even if I specify the file, it still doesn't adjust it.
Would be nice if the Cordova team integrates this (and cordova-icon) in the CLI, for each platform, something like:
cordova create splash android
cordova create icons ios
... something like that.
Keep up the good work!
Hello, I'd like to know how to set a timeout to the splash screen using this plugin.
Thanx for all help.
I see the following issue on both Android and iOS with long screens. This was iPhone X (simulated). I see the same on a new Android with similar screen dimensions.
Can someone point me at the docs that describe how the splashscreen plugin looks for splashscreen images on different platforms and I will have a go at fixing this.
Hi there and thanks for a great script! I used the cordova-icon script and it worked great, although I got problems with the cordova-splash execution. I installed it through npm and all seemed OK, until I tried to run it. I get this "Unhandled 'error' event" problem.
Any ideas?
Here is the feedback I get in the console when running cordova-splash:
Checking Project & Splash
✓ platforms found: ios
✓ splash.png exists
✓ config.xml exists
Generating splash screen for ios
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn identify ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
Hi - and thank you very much for this great tool! :)
cordova-splash puts all iOS-related resources into an .xcasetts folder - fine.
But the standard Cordova project wants to work with the Resources folder and thus the generated resources are not being picked up, but still the old defaults.
I am using Cordova-iOS 3.9.1 - as there are some essential plugins (like https://github.com/Telerik-Verified-Plugins/WKWebView) that do not work with the 4.x tooling.
Thanks.
Nice tool. thank you..
Should it find and generate an OSX splash ?
For me it does not
also i dont know if you want to add detection for the browser browser ?
x-MacBook-Pro:md01 apple$ cordova-splash --config=config.xml --splash=icon.png
Checking Project & Splash
✓ platforms found: ios, android
✓ icon.png exists
✓ config.xml exists
Generating splash screen for ios
resize arg
arg 750x1334
resize arg
arg 2048x1536
resize arg
arg 640x1136
resize arg
arg 1024x768
resize arg
arg 1536x2048
resize arg
arg 320x480
resize arg
arg 1242x2208
resize arg
arg 640x960
resize arg
arg 768x1024
resize arg
arg 2208x1242
✓ Default~iphone.png created
✓ Default@2x~iphone.png created
✓ Default-568h@2x~iphone.png created
✓ Default-Landscape~ipad.png created
✓ Default-Portrait~ipad.png created
✓ Default-667h.png created
✓ Default-Portrait@2x~ipad.png created
✓ Default-Landscape@2x~ipad.png created
✓ Default-736h.png created
✓ Default-Landscape-736h.png created
Generating splash screen for android
resize arg
arg 320x200
resize arg
arg 480x320
✓ drawable-land-ldpi/screen.png created
resize arg
arg 1280x720
resize arg
arg 1280x1920
resize arg
arg 800x480
resize arg
arg 1920x1280
resize arg
arg 1600x960
resize arg
arg 480x800
resize arg
arg 200x320
resize arg
arg 720x1280
resize arg
arg 320x480
✓ drawable-land-mdpi/screen.png created
resize arg
arg 960x1600
✓ drawable-port-ldpi/screen.png created
✓ drawable-port-mdpi/screen.png created
✓ drawable-land-hdpi/screen.png created
✓ drawable-port-hdpi/screen.png created
✓ drawable-land-xhdpi/screen.png created
✓ drawable-port-xhdpi/screen.png created
✓ drawable-land-xxhdpi/screen.png created
✓ drawable-port-xxhdpi/screen.png created
✓ drawable-port-xxxhdpi/screen.png created
✓ drawable-land-xxxhdpi/screen.png created
x-MacBook-Pro:md01 apple$ cordova-icon --config=config.xml --splash=icon.png
Checking Project & Icon
✓ platforms found: ios, android, osx
✓ icon.png exists
✓ config.xml exists
Generating Icons for ios
✓ [email protected] created
✓ [email protected] created
✓ icon-small.png created
✓ icon-76.png created
✓ [email protected] created
✓ icon-72.png created
✓ [email protected] created
✓ [email protected] created
✓ icon-60.png created
✓ [email protected] created
✓ icon-50.png created
✓ [email protected] created
✓ icon-40.png created
✓ [email protected] created
✓ icon.png created
✓ [email protected] created
✓ [email protected] created
Generating Icons for android
✓ drawable-mdpi/icon.png created
✓ drawable-ldpi/icon.png created
✓ drawable-hdpi/icon.png created
✓ drawable/icon.png created
✓ drawable-xhdpi/icon.png created
✓ drawable-xxhdpi/icon.png created
✓ drawable-xxxhdpi/icon.png created
Generating Icons for osx
✓ icon-64x64.png created
✓ icon-32x32.png created
✓ icon-16x16.png created
✓ icon-128x128.png created
✓ icon-256x256.png created
✓ icon-512x512.png created
Thanks for the useful utility.
Quick comment on the sizing of the original image: similar to ionic framework, you should try to use images that are 2208x2208 px with a center square of about 1200x1200 px. You can also use larger images with similar proportions.
This seemed to work in my tests (and it took me a while to figure out).
Hi there
here's what I get (with just android & android and ios platforms)
events.js:160
throw er; //Unhandled error event
Error: spawn identify ENOENT
at exports._errnoException (util.js:1022:11)
at Provess.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Any ideas? - running on Windows, installed today 30th Dec 2016
They could add support to some Xiaomi cell phones, especially those of larger screens:
Redmi Plus 5 / Redmi Note 5 / Redmi Note 6 (5.99" - 1080 x 2160)
Thanks!
I thought someone may have created a tool to automate generation of splash graphics... and Google directed me here :-) Very nice.... but I am getting this error:
$ cordova-splash
Checking Project & Splash
✓ platforms found: ios, android
✓ splash.png exists
✓ config.xml exists
Generating splash screen for ios
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn identify ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
at child_process.js:1137:20
at process._tickCallback (node.js:355:11)
Installed cordova-splash today, and using Cordova version 4.2.0
Just got my artist to do a 2208 with 1200 active area and ran up the iOS splashes
Some images were e.g. Default-2436h.png - cropped too much
Got him to change the central area to 1024x1024 and everything looks good
Love your utils - should be part of standard Cordova...
All the images are created properly, but I don't see any adjustments made to config.xml. It detects it, and even if I specify the file, it still doesn't adjust it.
How do i provide different source images for different platforms?
iOS requires us to specify squared - no transparency image so ios can crop it. This doesn't make sense in Android, so I wanna provide different image. What's the approach?
Pardon, this was meant for cordova-icon
Hello.
First of all, thank you for the excellent work.
I noticed that on Android the splashscreen images are being generated and written into /platforms/android/app/src/main/res
when the project is supposedly looking for the splashscreens in /platforms/android/res
.
Am I missing something here?
Cheers!
Hi. I see it says its making the screens from the master splash png, and I see files in the folders in the app root. But when I compile the app with cordova, the splash screen doesnt work. Any advice about what I might be doing wrong?
Is it possible to make it work for jpg files too?
I got "not a png file" error from mergeDebugResources
task when I tried to use a jpg file.
I am using cordova-ios version 3.9.2. Which version of cordova-splash should I use for this build ?
Thanks
Cordova android 7.0 platform have changed the project structure, and when i try to generate the splashscreen for android, it are created in a wrong path.
There is the way to configure the right path?
Some screen sizes where missing for portrait mode, here is a little fix:
platforms.push({
name : 'android',
isAdded : fs.existsSync('platforms/android'),
splashPath : 'platforms/android/res/',
splash : [
{ name : 'drawable/screen.png', width : 480, height: 640 },
{ name : 'drawable-hdpi/screen.png', width : 320, height: 426 },
{ name : 'drawable-ldpi/screen.png', width : 320, height: 470 },
{ name : 'drawable-mdpi/screen.png', width : 480, height: 640 },
{ name : 'drawable-xhdpi/screen.png', width : 720, height: 960 },
{ name : 'drawable-port-hdpi/screen.png', width : 480, height: 800 },
{ name : 'drawable-port-ldpi/screen.png', width : 200, height: 320 },
{ name : 'drawable-port-mdpi/screen.png', width : 320, height: 480 },
{ name : 'drawable-port-xhdpi/screen.png', width : 720, height: 1280 },
]
});
Thanks.
I see support for iPhone XS and XR was added, along with the package.json file updated to change to v1.0.1
. However, NPM still has v1.0.0
as the latest.
Error: Command failed: cordova-splash --splash=config/splash.png
module.js:540
throw err;
^
Error: Cannot find module '../../platforms/android/cordova/version'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at getAndroidFolder (/Users/zarko/.nvm/versions/node/v8.9.4/lib/node_modules/cordova-splash/index.js:27:16)
at getPlatforms (/Users/zarko/.nvm/versions/node/v8.9.4/lib/node_modules/cordova-splash/index.js:73:18)
at atLeastOnePlatformFound (/Users/zarko/.nvm/versions/node/v8.9.4/lib/node_modules/cordova-splash/index.js:243:3)
at Object. (/Users/zarko/.nvm/versions/node/v8.9.4/lib/node_modules/cordova-splash/index.js:300:1)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
For Cordova CLI [email protected] the location for the splash images have moved.
/Images.xcassets/LaunchImage.launchimage/
Hi Alex, thanks for sharing cordova-splash, it has saved me a lot of time already. Because I was missing iPhone6 and 6-Plus images (the default cordova image kept showing up) I updated cordova-splash and the images are generated perfectly. However, I'm now getting the following errors, I thought it would be useful to mention this.
[Error: Command failed: convert: unable to open image platforms/android/res/drawable-port-ldpi/screen.png': No such file or directory @ error/blob.c/OpenBlob/2643. convert: WriteBlob Failed
platforms/android/res/drawable-port-ldpi/screen.png' @ error/png.c/MagickPNGErrorHandler/1804.
] timedOut: false, killed: false, code: 1, signal: null }
Hey there!
Great tool thanks alot!
I get this error during the build after cleaning the splash dir and running the tool
The following build commands failed:
CpResource Analoc/Resources/splash/Default-736h.png build/emulator/Analoc.app/Default-736h.png
CpResource Analoc/Resources/splash/Default-Landscape@2xipad.png build/emulator/Analoc.app/Default-Landscape@2xipad.png
CpResource Analoc/Resources/splash/Default-Landscapeipad.png build/emulator/Analoc.app/Default-Landscapeipad.png
CpResource Analoc/Resources/splash/Default-Portrait@2xipad.png build/emulator/Analoc.app/Default-Portrait@2xipad.png
CpResource Analoc/Resources/splash/Default-Portraitipad.png build/emulator/Analoc.app/Default-Portraitipad.png
CpResource Analoc/Resources/splash/Default-667h.png build/emulator/Analoc.app/Default-667h.png
CpResource Analoc/Resources/splash/Default@2xiphone.png build/emulator/Analoc.app/Default@2xiphone.png
CpResource Analoc/Resources/splash/Defaultiphone.png build/emulator/Analoc.app/Defaultiphone.png
Looks like there are missing sizes. Can you please fix?
Hey @AlexDisler
I, like many other people am now depending on cordova-splash (and cordova-icon).
Unfortunately the project has become a bit dormant.
Would you mind adding some more people as maintainers so we can continue pushing and merging code please 😄
See AlexDisler/cordova-icon#80 for more info
When trying to run I get error ...
`bash-3.2$ cordova-splash
Checking Project & Splash
✓ platforms found: ios
✓ splash.png exists
✓ config.xml exists
Generating splash screen for ios
resize arg
arg 1242x2208
resize arg
arg 750x1334
resize arg
arg 640x1136
resize arg
arg 2208x1242
resize arg
arg 2048x1536
resize arg
arg 1536x2048
resize arg
arg 1024x768
resize arg
arg 768x1024
resize arg
arg 640x960
resize arg
arg 320x480
{ [Error: Command failed: convert: unable to open image platforms/ios/Plantar Fasciitis Treatment/Resources/splash/Default-Landscape~ipad.png': No such file or directory @ error/blob.c/OpenBlob/2702. convert: WriteBlob Failed
platforms/ios/Plantar Fasciitis Treatment/Resources/splash/Default-Landscape~ipad.png' @ error/png.c/MagickPNGErrorHandler/1630.
] timedOut: false, killed: false, code: 1, signal: null }`
once i have generated the icons and splash for my platforms, if i change the icon.png or splash.png, regenerate them, and then rebuild my platforms, i dont see the new icon and splash images.
Maybe i am doing something wrong ?
-compile:
[javac] Compiling 10 source files to /var/lib/jenkins/jobs/mobilezuz-android/workspace/platforms/android/ant-build/classes
[javac] /var/lib/jenkins/jobs/mobilezuz-android/workspace/platforms/android/src/org/apache/cordova/splashscreen/
[javac] if (webView.canGoBack()) {
[javac] ^
[javac] symbol: method canGoBack()
[javac] location: variable webView of type CordovaWebView
[javac] 1 error
Any ideas?
Somebody submitted this project at VersionEye. But without a tag there is not much to track. Why not creating a first SNAPSHOT tag? And please use semantic versioning ;-)
Im getting a error when i run cordova-splash in my root folder:
Checking Project & Splash
V platforms found: android
V splash.png exists
V config.xml exists
Generating splash screen for android
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn identify ENOENT
at exports._errnoException (util.js:870:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at doNTCallback2 (node.js:441:9)
at process._tickCallback (node.js:355:17)
ImageMagick is installed.
nodejs version: 4.4.3
Any help is much appreciated.
I have successfully gotten the splash (and icon screen) to load on iOS but on my Samsung Galaxy 3; I cannot see the splash screen. Instead, I get a black screen instead. It is worth noting that:
Here is the output which seems fine:
$ cordova run android
Running command: /Users/Sam/Projects/app/c3c/hooks/after_prepare/cordova-icon.sh /Users/Sam/Projects/app/c3c
Checking Project & Icon
✓ platforms found: ios, android
✓ icon.png exists
✓ config.xml exists
Generating Icons for ios
✓ [email protected] created
✓ icon-60.png created
✓ [email protected] created
✓ icon-50.png created
✓ [email protected] created
✓ icon-40.png created
✓ icon-72.png created
✓ [email protected] created
✓ [email protected] created
✓ [email protected] created
✓ icon-76.png created
✓ [email protected] created
✓ icon-small.png created
✓ icon.png created
✓ [email protected] created
Generating Icons for android
✓ drawable/icon.png created
✓ drawable-ldpi/icon.png created
✓ drawable-mdpi/icon.png created
✓ drawable-hdpi/icon.png created
✓ drawable-xhdpi/icon.png created
Checking Project & Splash
✓ platforms found: ios, android
✓ splash.png exists
✓ config.xml exists
Generating splash screen for ios
resize arg
arg 1536x2048
resize arg
arg 320x480
resize arg
arg 640x960
resize arg
arg 750x1334
resize arg
arg 2048x1536
resize arg
arg 640x1136
resize arg
arg 2208x1242
resize arg
arg 1242x2208
resize arg
arg 768x1024
resize arg
arg 1024x768
✓ Default~iphone.png created
✓ Default@2x~iphone.png created
✓ Default-568h@2x~iphone.png created
✓ Default-Landscape~ipad.png created
✓ Default-Portrait~ipad.png created
✓ Default-667h.png created
✓ Default-Portrait@2x~ipad.png created
✓ Default-Landscape@2x~ipad.png created
✓ Default-Landscape-736h.png created
✓ Default-736h.png created
Generating splash screen for android
resize arg
arg 320x200
resize arg
arg 800x480
resize arg
arg 720x1280
resize arg
arg 1280x720
resize arg
arg 480x800
resize arg
arg 480x320
resize arg
arg 200x320
resize arg
arg 320x480
✓ drawable-land-ldpi/screen.png created
✓ drawable-port-ldpi/screen.png created
✓ drawable-port-mdpi/screen.png created
✓ drawable-land-mdpi/screen.png created
✓ drawable-land-hdpi/screen.png created
✓ drawable-port-hdpi/screen.png created
✓ drawable-port-xhdpi/screen.png created
✓ drawable-land-xhdpi/screen.png created
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.