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

Android: Allow asset directory names with a leading underscore to be included in the build

    Details

    • Story Points:
      3
    • Sprint:
      2018 Sprint 12 SDK, 2018 Sprint 13 SDK, 2018 Sprint 14 SDK, 2018 Sprint 15 SDK, 2018 Sprint 16 SDK, 2016 Sprint 17 SDK, 2018 Sprint 18 SDK, 2018 Sprint 19 SDK

      Description

      Summary:
      Directory names have a leading underscore '_' (ex: "_MyDirectory") are automatically excluded from the built Android APK's "assets" directory. Google did this intentionally with their "aapt" command line tool. We should change this behavior since iOS and Windows doesn't have this restriction. (Makes it less confusing too.)

      For JavaScript files under these directories, they will only be excluded when building for the emulator since they're added to the APK's "assets" directory in this case. For "device" and "production" builds, the JavaScript will be correctly included, but this is because they're compiled/encrypted and not bundled under the APK's "assets" directory in this case.

      Steps to reproduce:

      1. Create a Titanium "Classic" app.
      2. Copy the attached Test.zip file's contents to your app.
      3. Build and run the app for the Android emulator.
      4. On app startup, a runtime error will occur where require() will fail to find the JavaScript file under directory "_Test".
      5. Build and run the app to an Android device. (Note the emulator.)
      6. On app startup, note that a window is displayed, but it fails to display an image. (The JS files was loaded, but the "_Test/AppcLogo.png" did not get included into the APK.)

      Cause:
      Google's command line tool "aapt" will automatically exclude the following from the APK's assets directory:

      • .svn
      • .git
      • .ds_store
      • .scc
      • .CVS
      • thumbs.db
      • picasa.ini
      • _<directory>

      We can change this behavior by using "aapt" argument --ignore-assets and tell it not to omit directories with a leading underscore.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Lokesh Choudhary
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code