Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24553] Android: Build breaks if <icon> contains a non-[a-z0-9_.] character

GitHub Issuen/a
TypeBug
PriorityNone
StatusResolved
ResolutionHold
Resolution Date2019-06-04T15:34:42.000+0000
Affected Version/sRelease 6.0.3, Release 8.0.0
Fix Version/sn/a
ComponentsAndroid, Tooling
Labelscb-tooling, engTriage
ReporterChris Barber
AssigneeChris Barber
Created2017-04-03T23:18:27.000+0000
Updated2019-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.

Comments

  1. Joshua Quick 2017-04-11

    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.

JSON Source