[TIMOB-24553] Android: Build breaks if <icon> contains a non-[a-z0-9_.] character
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Resolved |
Resolution | Hold |
Resolution Date | 2019-06-04T15:34:42.000+0000 |
Affected Version/s | Release 6.0.3, Release 8.0.0 |
Fix Version/s | n/a |
Components | Android, Tooling |
Labels | cb-tooling, engTriage |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2017-04-03T23:18:27.000+0000 |
Updated | 2019-06-04T15:34:59.000+0000 |
Description
When building an app for Android and the
<icon>
in the tiapp.xml refers to a filename with a character that doesn't match the regex a-z0-9_.
, then the build fails with:
[ERROR] Failed to package application:
[ERROR]
[ERROR] res/drawable/appicon-76.png: Invalid file name: must contain only [a-z0-9_.]
Workaround is to only use a-z0-9_.
characters in the appicon filename.
This ticket is invalid if we get around to creating a universal asset management system.
This is partly a native Android limitation. Google's Android build system (not Appcelerator) generates an "R.java" file where a Java constant gets created for each file under the APK's "res" folder. The "res" file names are used as-is during code generation. So, file names containing spaces, dashes, leading numbers, or Java keywords (if, for, where, etc.) would cause compiler errors on Google's end. Perhaps we should validate the files under the "res" folder first to provide a more useful build failure message to the developer? The validation code can be similar to what we use to validate a Titanium "Application Id", which gets turned into an Android package name.