[TIMOB-19809] iOS: "There are missing app icons" error is returned if you build a mobile project pre-5.0.0 stack
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-10-29T01:52:07.000+0000 |
Affected Version/s | Release 5.1.0 |
Fix Version/s | Release 5.1.0 |
Components | CLI, iOS |
Labels | qe-5.1.0 |
Reporter | Wilson Luu |
Assignee | Chris Barber |
Created | 2015-10-27T23:41:00.000+0000 |
Updated | 2015-10-30T00:45:13.000+0000 |
Description
*Details:* "There are missing app icons" error is returned if you build a mobile project pre-5.0.0 stack that *DOES have all required app icons.*
*Steps to reproduce:*
Create an Alloy project using pre-5.0.0 stack:
** Appc CLI NPM: 4.1.1
** Appc CLI Core: 4.1.3
** SDK: 4.1.0.GA
** Node: v0.12.7
** OS: El Capitan (10.11.1)
After the Alloy project is created, switch your environment to 5.1.X stack; see above environment field
Next, clean your Alloy project with appc ti clean
Then, install your Alloy project to an iOS device
*Actual:* "There are missing app icons" error and 'alpha channel' warnings are returned; see attachment.
*Expected:*
||Required App Icons||Optional App Icons||DefaultIcon.png||DefaultIcon-ios.png||Expected Result||
|All present, correct size, no alpha|All present, correct size, no alpha|doesn't matter|doesn't matter|build succeeds|
|Missing 1 required icon|All present, correct size, no alpha|no|no|build fails|
|Missing 1 required icon|All present, correct size, no alpha|yes w/o alpha|no|missing icon generated from DefaultIcon.png, build succeeds|
|Missing 1 required icon|All present, correct size, no alpha|yes w/ alpha|no|DefaultIcon.png flattened, missing icon generated from DefaultIcon.png, build succeeds|
|1 or more icons have alpha|All present, correct size, no alpha|none|none|app icon is flattened, build succeeds|
|1 or more icons have alpha|All present, correct size, no alpha|yes w alpha|none|app icons are flattened, build succeeds|
|1 or more icons have alpha|All present, correct size, no alpha|yes w alpha|yes w/o alpha|generates non-alpha icons from DefaultIcon-ios.png, build succeeds|
|Icon has wrong size|All present, correct size, no alpha|no|no|build fails|
|Icon has wrong size|All present, correct size, no alpha|yes w/o alpha|no|generates app icon from DefaultIcon.png with correct size, build succeeds|
|Icon has wrong size|All present, correct size, no alpha|yes w/ alpha|no|flattens DefaultIcon.png, generates app icon from DefaultIcon.png with correct size, build succeeds|
|Icon has wrong size|All present, correct size, no alpha|yes w/ alpha|yes w/o alpha|generates app icon from DefaultIcon-ios.png with correct size, build succeeds|
|All present, correct size, no alpha|Missing app icon|no|no|prints warning, build succeeds|
|All present, correct size, no alpha|Missing app icon|yes w/ alpha|no|DefaultIcon.png flattened, missing icon generated from DefaultIcon.png, build succeeds|
|All present, correct size, no alpha|Missing app icon|yes w/ alpha|yes w/ alpha|DefaultIcon-ios.png flattened, missing icon generated from DefaultIcon-ios.png, build succeeds|
|All present, correct size, no alpha|Missing app icon|yes w/ alpha|yes w/o alpha|Missing icon generated from DefaultIcon-ios.png, build succeeds|
Attachments
File | Date | Size |
magic.png | 2015-10-27T23:40:23.000+0000 | 683800 |
Based on http://docs.appcelerator.com/platform/release-notes/?version=5.0.0.GA#deprecated_icons, building a pre-5.0.0 project with a 5.0.0+ SDK is expected to fail due to missing icons. This, the "Expected: You should be able to build a mobile project pre-5.0.0 stack without any issues." is incorrect, as the complete set of icons does not exist, and there is no DefaultIcon.png in the project. However, the error about missing icons (while pointing to those at least some of the same icons existing in the project) is confusing and should be fixed.
would recommend a changed summary as the current one is non-obvious (to me)
[~ingo], This ticket is addressing the issue whereby the complete set of icons *does exist* (but with alpha channel) and it's causing the error. We should be flattening the app icons in Resource folder if no DefaultIcon.png exist. So the expected statement here is still valid.
You sure? appicon-76 and appicon-76@2x do not exist. Some icons are missing, and some icons have alpha channels. The error messages should be distinct. If you did have a complete set of proper icons from a 4.X project, it should not fail the build. But I believe the default set of icons for either a classic or Alloy project is not complete. So given these reproduction steps, the expected statement is invalid.
ok we'll see how we can improve the messages. Just to make sure everyone's clear: Expected Results should be: ||No.||Project version||DefaultIcon.png||*Required* icons in Resource folder (or assets/iphone)||Expected Result when built post-5.0.0|| |1|pre 5.0.0|exist|exist and has alpha channel|build successfully| |2|pre 5.0.0|exist|exist and has no alpha channel|build successfully| |3|pre 5.0.0|exist|don't exist|build successfully| |4|pre 5.0.0|don't exist|exist and has alpha channel|build successfully| |5|pre 5.0.0|don't exist|exist and has no alpha channel|build successfully| |6|pre 5.0.0|don't exist|don't exist|fail and indicate requirement for a DefaultIcon.png| So the scenarios to address are 1 and 4. whereby we need to flatten the icons in the resource/assets folder.
Master PR: https://github.com/appcelerator/titanium_mobile/pull/7364 5_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/7365
Here's how this works. We want perfect app icons without alpha. If there's an app icon with alpha, it searches for DefaultIcon-ios.png. If DefaultIcon-ios.png does not exist, it falls back to DefaultIcon.png. If the default icon does not have alpha, it is used to generate all missing icons. If there are missing app icons and a default icon with alpha, it will first flatten the default icon before generating the missing app icons. If an app icon exists, but has alpha, it will first try to generate the app icon using a non-alpha default icon, but if it has to flatten an image, it will just use the app icon, not the default icon. So, the test matrix looks like this: ||Required App Icons||Optional App Icons||DefaultIcon.png||DefaultIcon-ios.png||Expected Result|| |All present, correct size, no alpha|All present, correct size, no alpha|doesn't matter|doesn't matter|build succeeds| |Missing 1 required icon|All present, correct size, no alpha|no|no|build fails| |Missing 1 required icon|All present, correct size, no alpha|yes w/o alpha|no|missing icon generated from DefaultIcon.png, build succeeds| |Missing 1 required icon|All present, correct size, no alpha|yes w/ alpha|no|DefaultIcon.png flattened, missing icon generated from DefaultIcon.png, build succeeds| |1 or more icons have alpha|All present, correct size, no alpha|none|none|app icon is flattened, build succeeds| |1 or more icons have alpha|All present, correct size, no alpha|yes w alpha|none|app icons are flattened, build succeeds| |1 or more icons have alpha|All present, correct size, no alpha|yes w alpha|yes w/o alpha|generates non-alpha icons from DefaultIcon-ios.png, build succeeds| |Icon has wrong size|All present, correct size, no alpha|no|no|build fails| |Icon has wrong size|All present, correct size, no alpha|yes w/o alpha|no|generates app icon from DefaultIcon.png with correct size, build succeeds| |Icon has wrong size|All present, correct size, no alpha|yes w/ alpha|no|flattens DefaultIcon.png, generates app icon from DefaultIcon.png with correct size, build succeeds| |Icon has wrong size|All present, correct size, no alpha|yes w/ alpha|yes w/o alpha|generates app icon from DefaultIcon-ios.png with correct size, build succeeds| |All present, correct size, no alpha|Missing app icon|no|no|prints warning, build succeeds| |All present, correct size, no alpha|Missing app icon|yes w/ alpha|no|DefaultIcon.png flattened, missing icon generated from DefaultIcon.png, build succeeds| |All present, correct size, no alpha|Missing app icon|yes w/ alpha|yes w/ alpha|DefaultIcon-ios.png flattened, missing icon generated from DefaultIcon-ios.png, build succeeds| |All present, correct size, no alpha|Missing app icon|yes w/ alpha|yes w/o alpha|Missing icon generated from DefaultIcon-ios.png, build succeeds| The only time the build fails is if you are missing a required icon or a required icon has the wrong dimensions and you don't have a DefaultIcon.png. Required app icons are
appicon-60@2x.png
,appicon-60@3x.png
,appicon-76.png
, andappicon-76@2x.png
. Optional app icons areappicon-Small.png
,appicon-Small@2x.png
,appicon-Small@3x.png
,appicon-Small-40.png
,appicon-Small-40@2x.png
, andappicon-Small-40@3x.png
. Default icons are prioritized byDefaultIcon-ios.png
,DefaultIcon-iphone.png
, and finallyDefaultIcon.png
. IfDefaultIcon-ios.png
andDefaultIcon.png
exists, butDefaultIcon-ios.png
is invalid, it will NOT fallback toDefaultIcon.png
. It will fail the build if there are missing required app icons and the selected default icon is not valid.[~emerriman] may hug you for that table.
[~cbarber], can you clarify this statement you wrote? {quote} Default icons are prioritized by DefaultIcon-ios.png, DefaultIcon-ios.png, and finally DefaultIcon.png. {quote} you do mean this right? {quote} Default icons are prioritized by required app icons in folder, DefaultIcon-ios.png, and finally DefaultIcon.png. {quote}
[~cbarber] There are 3 scenarios i wish to verify from your table: ||Required App Icons||Optional App Icons||DefaultIcon.png||DefaultIcon-ios.png||Expected Result|| |Icon has wrong size|All present, correct size, no alpha|yes w alpha|yes w/o alpha|generates app icon from{color:red} DefaultIcon-ios.png{color} with correct size, build succeeds| |All present, correct size, no alpha|Missing app icon|yes w/ alpha|yes w/ alpha|DefaultIcon-ios.png flattened, missing icon generated from {color:red}DefaultIcon-ios.png{color}, build succeeds| |All present, correct size, no alpha|Missing app icon|yes w/ alpha|yes w/o alpha|Missing icon generated from {color:red}DefaultIcon-ios.png{color}, build succeeds|
[~cng] I specifically said "Default icons" because I meant "default icons". There was a typo. It should read: | Default icons are prioritized by
DefaultIcon-ios.png
,DefaultIcon-iphone.png
, and finallyDefaultIcon.png
.[~cng] I fixed the table per your findings.
CR and FT passed. PRs merged.
Closing ticket as fixed. Verified the following: ||Required App Icons||DefaultIcon.png||DefaultIcon-ios.png||Expected Result||Actual|| |Missing 1 required icon|no|no|build fails|(+)| |Missing 1 required icon|yes w/o alpha|no|missing icon generated from DefaultIcon.png, build succeeds|(+)| |Missing 1 required icon|yes w/ alpha|no|DefaultIcon.png flattened, missing icon generated from DefaultIcon.png, build succeeds|(+)| |1 or more icons have alpha|none|none|app icon is flattened, build succeeds|(+)| |1 or more icons have alpha|yes w alpha|none|app icons are flattened, build succeeds|(+)| |1 or more icons have alpha|yes w alpha|yes w/o alpha|generates non-alpha icons from DefaultIcon-ios.png, build succeeds|(+)| |Icon has wrong size|no|no|build fails|(+)| |Icon has wrong size|yes w/o alpha|no|generates app icon from DefaultIcon.png with correct size, build succeeds|(+)| |Icon has wrong size|yes w/ alpha|no|flattens DefaultIcon.png, generates app icon from DefaultIcon.png with correct size, build succeeds|(+)| |Icon has wrong size|yes w/ alpha|yes w/o alpha|generates app icon from DefaultIcon-ios.png with correct size, build succeeds|(+)| |All present, correct size, no alpha|no|no|prints warning, build succeeds|(+)| |All present, correct size, no alpha|yes w/ alpha|no|DefaultIcon.png flattened, missing icon generated from DefaultIcon.png, build succeeds|(+)| |All present, correct size, no alpha|yes w/ alpha|yes w/ alpha|DefaultIcon-ios.png flattened, missing icon generated from DefaultIcon-ios.png, build succeeds|(+)| |All present, correct size, no alpha|yes w/ alpha|yes w/o alpha|Missing icon generated from DefaultIcon-ios.png, build succeeds|(+)| *Notes:* * For testing, I did not focus on the *Optional App Icons* i.e. did not go out of my way to generate and modify those optional icons because they were optional. Hence, only focused on the *Required App Icons*, *DefaultIcon.png*, and *DefaultIcon-ios.png* and used the default Alloy project. * Verified the expected behavior by monitoring the trace logs per build and see if the app gets launched onto device. * As per Ingo's comment, will update the bug description with the *correct* expected behavior and file an *improvement* ticket in regards to the "error about missing icons"; those still appear. *Tested on:* Appc CLI NPM: 4.2.1 Appc CLI Core: 5.1.0-38 Arrow: 1.3.13 SDK: 5.1.0.v20151028190028 Node: v4.2.1 OS: El Capitan (10.11.1)