OK I worked the whole morning on this stuff.
First I have Cordova Version 3.5 and I worked with their docs for Version 3.5
Let’s first talk about icons:
I took this to code snippets:
<platform name="ios"> <!-- iOS 7.0+ --> <!-- iPhone / iPod Touch --> <icon src="res/ios/icon-60.png" width="60" height="60" /> <icon src="res/ios/icon-60@2x.png" width="120" height="120" /> <!-- iPad --> <icon src="res/ios/icon-76.png" width="76" height="76" /> <icon src="res/ios/icon-76@2x.png" width="152" height="152" /> <!-- iOS 6.1 --> <!-- Spotlight Icon --> <icon src="res/ios/icon-40.png" width="40" height="40" /> <icon src="res/ios/icon-40@2x.png" width="80" height="80" /> <!-- iPhone / iPod Touch --> <icon src="res/ios/icon.png" width="57" height="57" /> <icon src="res/ios/icon@2x.png" width="114" height="114" /> <!-- iPad --> <icon src="res/ios/icon-72.png" width="72" height="72" /> <icon src="res/ios/icon-72@2x.png" width="144" height="144" /> <!-- iPhone Spotlight and Settings Icon --> <icon src="res/ios/icon-small.png" width="29" height="29" /> <icon src="res/ios/icon-small@2x.png" width="58" height="58" /> <!-- iPad Spotlight and Settings Icon --> <icon src="res/ios/icon-50.png" width="50" height="50" /> <icon src="res/ios/icon-50@2x.png" width="100" height="100" /> </platform>
<platform name="android"> <icon src="res/android/ldpi.png" density="ldpi" /> <icon src="res/android/mdpi.png" density="mdpi" /> <icon src="res/android/hdpi.png" density="hdpi" /> <icon src="res/android/xhdpi.png" density="xhdpi" /> </platform>
So my first Problem was that I didn’t understand about what res folder they were talking. I thought about they icon tutorial on your learn site and made an icon folder in the root directory in my project folder. But thats different to their instructions and so the confusing starts.
But after a while i figured it out and thats my solution for now but it would work with an icons folder in root directory the same way. You only have to change the paths.
config.xml
`
<!-- iPad -->
<icon src="www/res/icons/ios/icon-76.png" width="76" height="76" />
<icon src="www/res/icons/ios/icon-76@2x.png" width="152" height="152" />
<!-- iOS 6.1 -->
<!-- Spotlight Icon -->
<icon src="www/res/icons/ios/icon-40.png" width="40" height="40" />
<icon src="www/res/icons/ios/icon-40@2x.png" width="80" height="80" />
<!-- iPhone / iPod Touch -->
<icon src="www/res/icons/ios/icon-57.png" width="57" height="57" />
<icon src="www/res/icons/ios/icon-57@2x.png" width="114" height="114" />
<!-- iPad -->
<icon src="www/res/icons/ios/icon-72.png" width="72" height="72" />
<icon src="www/res/icons/ios/icon-72@2x.png" width="144" height="144" />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="www/res/icons/ios/icon-small.png" width="29" height="29" />
<icon src="www/res/icons/ios/icon-small@2x.png" width="58" height="58" />
<!-- iPad Spotlight and Settings Icon -->
<icon src="www/res/icons/ios/icon-50.png" width="50" height="50" />
<icon src="www/res/icons/ios/icon-50@2x.png" width="100" height="100" />
</platform>
<platform name="android">
<icon src="www/res/icons/android/ldpi.png" density="ldpi" />
<icon src="www/res/icons/android/mdpi.png" density="mdpi" />
<icon src="www/res/icons/android/hdpi.png" density="hdpi" />
<icon src="www/res/icons/android/xhdpi.png" density="xhdpi" />
</platform>`
I made my OWN res folder in my www folder and I had to change the path for the icons!
I know its not complicated but its so confusing. Ionic tells you to make an icons folder in root but cordova docs talk about an res folder and there are many res folders. In platforms, in ant-build and so on so its pretty confusing. But i figured it out now. I hope it helps some beginners because for me it was pretty frustrating. And sorry for my english but I am from austria. I hope its understandable what I am talking about.
so lets move to splash screens:
They tell you to make a folder www/res/screens
and then they have this snippets:
android/screen-hdpi-landscape.png android/screen-hdpi-portrait.png android/screen-ldpi-landscape.png android/screen-ldpi-portrait.png android/screen-mdpi-landscape.png android/screen-mdpi-portrait.png android/screen-xhdpi-landscape.png android/screen-xhdpi-portrait.png
ios/screen-ipad-landscape-2x.png ios/screen-ipad-landscape.png ios/screen-ipad-portrait-2x.png ios/screen-ipad-portrait.png ios/screen-iphone-landscape-2x.png ios/screen-iphone-landscape.png ios/screen-iphone-portrait-2x.png ios/screen-iphone-portrait.png ios/screen-iphone-portrait-568h-2x.png
I did that but I don’t know how to define them in config.xml
So i tried it without defining but the build fails.
Error:
The following build commands failed: CpResource UFC\ Obritz/Resources/splash/Default-Landscape~ipad.png build/emulator/UFC\ Obritz.app/Default-Landscape~ipad.png CpResource UFC\ Obritz/Resources/splash/Default-Landscape@2x~ipad.png build/emulator/UFC\ Obritz.app/Default-Landscape@2x~ipad.png CpResource UFC\ Obritz/Resources/splash/Default-Portrait@2x~ipad.png build/emulator/UFC\ Obritz.app/Default-Portrait@2x~ipad.png CpResource UFC\ Obritz/Resources/splash/Default-Portrait~ipad.png build/emulator/UFC\ Obritz.app/Default-Portrait~ipad.png
So the build task is looking for completely different icon names than the doku says you…why?
Why does that happen?
It doesn’t work like they are saying.
I could solve this problem when I copied all my splash screens to platforms/ios/Resources/splash
and named it like the ones in the errors.
The same for android. I had to copy it by myself to platforms/android/res/
and name it screen.png
. The doku says I should add this two lines to config.xml
<preference name="SplashScreen" value="screen" /> <preference name="SplashScreenDelay" value="10000" />
and because of that I had to name the files screen.png
(value=screen)
Now iOS Splash Screen is working but Android don’t.
I will add my solution if i find one.
It would be awesome if I could help someone to understand it a little bit better and if I am the only one who is confused about this “simple” things…help me please =D