Fail the build on undersized localized launcher icons#5208
Merged
Conversation
Localized launcher icons (cn1_icon_<lang>[_<country>].png) are scaled up to the largest launcher density at build time, so a low-resolution source produces a blurry icon. Two related problems were reported on Android: 1. A small localized icon was upscaled and shipped blurry with no warning. 2. Maven copies these resources into target/classes incrementally and does not delete stale copies when a source icon is removed/renamed, so an old low-res icon kept getting bundled until 'mvn clean' was run manually. This adds a hard build failure (not just a warning) when a localized icon is smaller than the size it would be upscaled to (192px normally, 432px for the adaptive foreground), so a soft icon can no longer reach production: - AndroidGradleBuilder.processLocalizedIcons: collects undersized icons and throws a BuildException with a clear message before producing the APK. - CN1BuildMojo: scans the compiled output (target/classes) that is about to be bundled and sent to the build server and fails with a MojoFailureException, pointing at stale copies and recommending 'mvn clean'. Docs updated with the resolution recommendation and the stale-resource note. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
Contributor
Cloudflare Preview
|
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 128 screenshots: 128 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 121 screenshots: 121 matched. |
Use contractions (doesn't / that's) to satisfy the Microsoft.Contractions rule in the developer-guide quality gate, and update the wording from "logs a warning" to "fails the build" to match the new behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Compared 128 screenshots: 128 matched. Benchmark Results
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 128 screenshots: 128 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 124 screenshots: 124 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
A customer using the localizable app-icon feature (
cn1_icon_<lang>[_<country>].png) on Android reported two problems:target/classes. Maven's resource plugin copiessrc/main/resources→target/classesincrementally and never deletes a copy when the source file is removed or renamed. So an outdated low-res icon kept getting bundled and sent to the build server untilmvn cleanwas run by hand.The localizer itself was working correctly — it was faithfully upscaling a too-small source. The fix is to stop letting such an icon reach production.
Change
Both the server-side Android builder and the local Maven build now fail the build (not just warn) when a localized icon is smaller than the size it would be upscaled to:
AndroidGradleBuilder.processLocalizedIcons— collects every undersized localized icon and throws aBuildExceptionwith a clear message before the APK is produced. The threshold matches whatwriteLocalizedIconSetemits (192px, or 432px whenandroid.enableAdaptiveIcons=true). This surfaces in the cloud-build log.CN1BuildMojo— before assembling the jar-with-dependencies that is sent to the build server, scans the compiled output directories (each module'starget/classes) forcn1_icon_*.pngand fails with aMojoFailureException, listing the offenders and pointing at stale copies with a recommendation to runmvn clean. This catches the problem on the developer's machine before a build is even sent.Per the reported use case (server builds, Android)
IPhoneBuilderis intentionally left unchanged.Docs
Miscellaneous-Features.asciidocnow recommends 1024×1024 localized icons, documents the new build failure, and adds a NOTE explaining Maven's incremental resource copy and themvn cleanfix.Testing
mvn -o -pl codenameone-maven-plugin compile→ BUILD SUCCESS.🤖 Generated with Claude Code