Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27718

Android: Log build warnings if "res" files have invalid names


    • Story Points:
    • Sprint:
      2020 Sprint 2


      An Android APK's "res" files (such as drawables) have the following restictions:

      • File names can only have lower-case letters, numbers, or underscores.
      • File names cannot start with a number.
      • Cannot be placed in subdirectories.

      The above limitations are by Google's design, because the Android build system turns "res" file names into Java constants under the generated R class. Violating the above will result in a build failure.

      However, Titanium allows app developers to violate the above rules and will lower-case the file name and replace illegal characters and directory separators with '_' underscores.

      App Changes for Titanium 9.0.0:
      For app builds, we want to maintain backward compatibility. This means allowing app developer to continue to violate Google's "res" file naming rules, but we should log a build WARNING for every "res" file in violation to compel app developer's to follow Google's best-practices. This will also help minimize confusion when attempting to access a "res" file via native Java APIs using the illegal name, which won't work.

      Module Changes for Titanium 9.0.0:
      Native modules built with Titanium 9.0.0 and higher will no longer be allowed to violate Google's "res" file naming rules. This is because we're now building a native module to an AAR library which packages the module's "res" files. So, illegal "res" file names will cause a build failure just like how it works in Android Studio.

      The attached Resources.zip contains a directory tree of image files which violate Google's "res" naming conventions.




            • Assignee:
              jquick Joshua Quick
              jquick Joshua Quick
              Gary Mathews
              Samir Mohammed
            • Watchers:
              4 Start watching this issue


              • Created:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration